COM Addin Problem after Update to Outlook 2003

S

Steven G

Hi folks!

I've written an COM-Addin in VBA. It worked with Outlook 2000 and XP,
but after updating from Outlook XP to 2003 there's no Addin. No Error
Message or other things happened. Only the Addin wasn't loaded. I've
tested the "OnConnection" Function with a message box but it wasn't
called at the Outlook Start! I deleted the Outlook Addin regkeys at
HKLM\Software\Microsoft\Office\Outlook\Addins\MyAddin.Connect and
HKCU\Software\Microsoft\Office\Outlook\Addins\MyAddin.Connect. Then I
deleted my Addin in Outlook under "Options/COM-Addins" and selected my
Addin dll again. After selecting my Addin was loaded. But after
restarting Outlook no Addin was loaded, although my Addin was listed
under "Options/COM-Addins"
I've checked the disabled elements in Outlook, but there was nothing.
I'm working with Outlook 2003 without SP1 and MacAfee VirusScan
Enterprise 7.1.0.

Any ideas?

Steven

Here is my code:

Connect.dsr:
-------------------------------------------------------------------------------
Option Explicit

Implements IDTExtensibility2

'=============================================================================
'= Private Members
'=============================================================================
' Instance of Base Class, handles all AddIn specific tasks
Private gBaseClass As New OutAddIn

'=============================================================================
'= Properties
'=============================================================================
Public Property Get LocalConnection() As ADODB.Connection
Set LocalConnection = gBaseClass.LocalConnection
End Property

Public Property Get NameSpace() As Outlook.NameSpace
Set NameSpace = gBaseClass.NameSpace
End Property

Public Property Get IsReplicationRunning() As Variant
IsReplicationRunning = gBaseClass.IsReplicationRunning
End Property

'=============================================================================
'= Private Methods
'=============================================================================
Private Sub IDTExtensibility2_OnAddInsUpdate(custom() As Variant)

On Error GoTo ErrHandler
Exit Sub

ErrHandler:
ReportAndLogError Err
End Sub

Private Sub IDTExtensibility2_OnBeginShutdown(custom() As Variant)

On Error GoTo ErrHandler
Exit Sub

ErrHandler:
ReportAndLogError Err
End Sub

Private Sub IDTExtensibility2_OnConnection(ByVal oApplication As
Object, _
ByVal ConnectMode As
AddInDesignerObjects.ext_ConnectMode, _
ByVal oAddInInst As
Object, custom() As Variant)

On Error GoTo ErrHandler

Call gBaseClass.InitHandler(oApplication, oAddInInst.ProgId)

ResHandler:
Exit Sub

ErrHandler:
ReportAndLogError Err
GoTo ResHandler
End Sub

Private Sub IDTExtensibility2_OnDisconnection(ByVal RemoveMode As
AddInDesignerObjects.ext_DisconnectMode, _
custom() As Variant)

On Error GoTo ErrHandler

Dim oCommandBar As Office.CommandBar

' If UserClosed, then remove the Items command bar
If RemoveMode = ext_dm_UserClosed Then
Set oCommandBar =
g_OutlookApplication.ActiveExplorer.CommandBars(cCommandBarName)
oCommandBar.Delete
End If

ResHandler:
'Tear down the class
gBaseClass.UnInitHandler
Set gBaseClass = Nothing
Exit Sub

ErrHandler:
ReportAndLogError Err
GoTo ResHandler
End Sub

Private Sub IDTExtensibility2_OnStartupComplete(custom() As Variant)

On Error GoTo ErrHandler
Exit Sub

ErrHandler:
ReportAndLogError Err
End Sub

-------------------------------------------------------------------------------
Here's the OutAddin.InitHandler:
-------------------------------------------------------------------------------

' Iintializes the Add In, creats all nessacary items
Friend Sub InitHandler(olApp As Outlook.Application, strProgID As
String)

On Error GoTo ErrHandler

Dim oNameSpace As Outlook.NameSpace
Dim oDataAccessor As GroupDataAccessor

' Show Start Screen
Load frmStartScreen
frmStartScreen.Show

'Declared WithEvents
Set m_OutlookApplication = olApp

'Instantiate a public module-level Outlook application variable
Set g_OutlookApplication = olApp

' Set Members
m_strAddInProgID = strProgID
Set oNameSpace = m_OutlookApplication.GetNamespace("MAPI")
Set m_OutlookExplorers = m_OutlookApplication.Explorers

' Create a dispatcher for all Item events.
Set m_oDispatcher = New OutlookDispatcher
m_OutlookApplication.COMAddIns.Item(m_strAddInProgID).object =
m_oDispatcher
Set m_oDispatcher.OutlookApplikation = m_OutlookApplication

'Create Replication Manager and init it
Set m_ReplicationManager = New ReplicationManager
Set m_ReplicationManager.OutlookApplikation = m_OutlookApplication

' Set Properties to Replication Manager
Set m_oEnvironment = New AVEnviroment.Enviroment

' Show Ikarus Version in Start Screen
With frmStartScreen
.setHeadline "My Addin"
.Refresh
End With

' Check if Outlook can/may be openend (Create DB Connection)
If Not CheckECInstallation Then
m_OutlookApplication.Quit
GoTo ResumeHandler
End If

' Load Group Cache
Set m_objGroups = New CoreClasses.Groups
Set oDataAccessor = New GroupDataAccessor
Call oDataAccessor.ReadGroups(m_oLocalConnection, m_objGroups)

' and set it to Replication Manager
Set m_ReplicationManager.LocalConnection = m_oLocalConnection
Set m_ReplicationManager.Groups = m_objGroups

' set some information to the Dispatcher, because he must known
the database connection
' and state of replication
Set m_oDispatcher.LocalConnection = Me.LocalConnection
m_oDispatcher.ReplicationRunning = False
Set m_oDispatcher.Groups = m_objGroups

'Only test features and instantiate objects if an Explorer object
exists
If m_OutlookExplorers.Count >= 1 Then
AddExplorer m_OutlookApplication.ActiveExplorer
CBOutlookItems
m_OutlookApplication.ActiveExplorer.CurrentFolder
End If

ResumeHandler:
' Hide Start Screen
frmStartScreen.Hide
Unload frmStartScreen

Set oNameSpace = Nothing
Set oDataAccessor = Nothing
Exit Sub

ErrHandler:
Err.Source = "InitHandler"
ReportAndLogError Err
Resume ResumeHandler
End Sub
-------------------------------------------------------------------------------
 
R

Roady [MVP]

You are better of asking this in the developers newsgroup;
microsoft.public.outlook.program_vba
microsoft.public.outlook.program_addins

--
Robert Sparnaaij [MVP-Outlook]
www.howto-outlook.com

Tips of the month:
-What do the Outlook Icons Mean?
-Create an Office 2003 CD slipstreamed with Service Pack 1

-----
 
K

Ken Slovak - [MVP - Outlook]

Does your addin show up in Help, About Microsoft Office Outlook, Disabled
Items button? If so click on Enable and exit and restart Outlook. See if
that works.




Steven G said:
Hi folks!

I've written an COM-Addin in VBA. It worked with Outlook 2000 and XP,
but after updating from Outlook XP to 2003 there's no Addin. No Error
Message or other things happened. Only the Addin wasn't loaded. I've
tested the "OnConnection" Function with a message box but it wasn't
called at the Outlook Start! I deleted the Outlook Addin regkeys at
HKLM\Software\Microsoft\Office\Outlook\Addins\MyAddin.Connect and
HKCU\Software\Microsoft\Office\Outlook\Addins\MyAddin.Connect. Then I
deleted my Addin in Outlook under "Options/COM-Addins" and selected my
Addin dll again. After selecting my Addin was loaded. But after
restarting Outlook no Addin was loaded, although my Addin was listed
under "Options/COM-Addins"
I've checked the disabled elements in Outlook, but there was nothing.
I'm working with Outlook 2003 without SP1 and MacAfee VirusScan
Enterprise 7.1.0.

Any ideas?

Steven

Here is my code:
<snip>
 
S

Steven G

Thanks. I'm going to post my question at the vba and the program_addins newsgroup...

Steven G

Roady said:
You are better of asking this in the developers newsgroup;
microsoft.public.outlook.program_vba
microsoft.public.outlook.program_addins

--
Robert Sparnaaij [MVP-Outlook]
www.howto-outlook.com

Tips of the month:
-What do the Outlook Icons Mean?
-Create an Office 2003 CD slipstreamed with Service Pack 1

-----
Steven G said:
Hi folks!

I've written an COM-Addin in VBA. It worked with Outlook 2000 and XP,
but after updating from Outlook XP to 2003 there's no Addin. No Error
Message or other things happened. Only the Addin wasn't loaded. I've
tested the "OnConnection" Function with a message box but it wasn't
called at the Outlook Start! I deleted the Outlook Addin regkeys at
HKLM\Software\Microsoft\Office\Outlook\Addins\MyAddin.Connect and
HKCU\Software\Microsoft\Office\Outlook\Addins\MyAddin.Connect. Then I
deleted my Addin in Outlook under "Options/COM-Addins" and selected my
Addin dll again. After selecting my Addin was loaded. But after
restarting Outlook no Addin was loaded, although my Addin was listed
under "Options/COM-Addins"
I've checked the disabled elements in Outlook, but there was nothing.
I'm working with Outlook 2003 without SP1 and MacAfee VirusScan
Enterprise 7.1.0.

Any ideas?

Steven

Here is my code:

Connect.dsr:
-------------------------------------------------------------------------------
Option Explicit

Implements IDTExtensibility2

'=============================================================================
'= Private Members
'=============================================================================
' Instance of Base Class, handles all AddIn specific tasks
Private gBaseClass As New OutAddIn

'=============================================================================
'= Properties
'=============================================================================
Public Property Get LocalConnection() As ADODB.Connection
Set LocalConnection = gBaseClass.LocalConnection
End Property

Public Property Get NameSpace() As Outlook.NameSpace
Set NameSpace = gBaseClass.NameSpace
End Property

Public Property Get IsReplicationRunning() As Variant
IsReplicationRunning = gBaseClass.IsReplicationRunning
End Property

'=============================================================================
'= Private Methods
'=============================================================================
Private Sub IDTExtensibility2_OnAddInsUpdate(custom() As Variant)

On Error GoTo ErrHandler
Exit Sub

ErrHandler:
ReportAndLogError Err
End Sub

Private Sub IDTExtensibility2_OnBeginShutdown(custom() As Variant)

On Error GoTo ErrHandler
Exit Sub

ErrHandler:
ReportAndLogError Err
End Sub

Private Sub IDTExtensibility2_OnConnection(ByVal oApplication As
Object, _
ByVal ConnectMode As
AddInDesignerObjects.ext_ConnectMode, _
ByVal oAddInInst As
Object, custom() As Variant)

On Error GoTo ErrHandler

Call gBaseClass.InitHandler(oApplication, oAddInInst.ProgId)

ResHandler:
Exit Sub

ErrHandler:
ReportAndLogError Err
GoTo ResHandler
End Sub

Private Sub IDTExtensibility2_OnDisconnection(ByVal RemoveMode As
AddInDesignerObjects.ext_DisconnectMode, _
custom() As Variant)

On Error GoTo ErrHandler

Dim oCommandBar As Office.CommandBar

' If UserClosed, then remove the Items command bar
If RemoveMode = ext_dm_UserClosed Then
Set oCommandBar =
g_OutlookApplication.ActiveExplorer.CommandBars(cCommandBarName)
oCommandBar.Delete
End If

ResHandler:
'Tear down the class
gBaseClass.UnInitHandler
Set gBaseClass = Nothing
Exit Sub

ErrHandler:
ReportAndLogError Err
GoTo ResHandler
End Sub

Private Sub IDTExtensibility2_OnStartupComplete(custom() As Variant)

On Error GoTo ErrHandler
Exit Sub

ErrHandler:
ReportAndLogError Err
End Sub

-------------------------------------------------------------------------------
Here's the OutAddin.InitHandler:
-------------------------------------------------------------------------------

' Iintializes the Add In, creats all nessacary items
Friend Sub InitHandler(olApp As Outlook.Application, strProgID As
String)

On Error GoTo ErrHandler

Dim oNameSpace As Outlook.NameSpace
Dim oDataAccessor As GroupDataAccessor

' Show Start Screen
Load frmStartScreen
frmStartScreen.Show

'Declared WithEvents
Set m_OutlookApplication = olApp

'Instantiate a public module-level Outlook application variable
Set g_OutlookApplication = olApp

' Set Members
m_strAddInProgID = strProgID
Set oNameSpace = m_OutlookApplication.GetNamespace("MAPI")
Set m_OutlookExplorers = m_OutlookApplication.Explorers

' Create a dispatcher for all Item events.
Set m_oDispatcher = New OutlookDispatcher
m_OutlookApplication.COMAddIns.Item(m_strAddInProgID).object =
m_oDispatcher
Set m_oDispatcher.OutlookApplikation = m_OutlookApplication

'Create Replication Manager and init it
Set m_ReplicationManager = New ReplicationManager
Set m_ReplicationManager.OutlookApplikation = m_OutlookApplication

' Set Properties to Replication Manager
Set m_oEnvironment = New AVEnviroment.Enviroment

' Show Ikarus Version in Start Screen
With frmStartScreen
.setHeadline "My Addin"
.Refresh
End With

' Check if Outlook can/may be openend (Create DB Connection)
If Not CheckECInstallation Then
m_OutlookApplication.Quit
GoTo ResumeHandler
End If

' Load Group Cache
Set m_objGroups = New CoreClasses.Groups
Set oDataAccessor = New GroupDataAccessor
Call oDataAccessor.ReadGroups(m_oLocalConnection, m_objGroups)

' and set it to Replication Manager
Set m_ReplicationManager.LocalConnection = m_oLocalConnection
Set m_ReplicationManager.Groups = m_objGroups

' set some information to the Dispatcher, because he must known
the database connection
' and state of replication
Set m_oDispatcher.LocalConnection = Me.LocalConnection
m_oDispatcher.ReplicationRunning = False
Set m_oDispatcher.Groups = m_objGroups

'Only test features and instantiate objects if an Explorer object
exists
If m_OutlookExplorers.Count >= 1 Then
AddExplorer m_OutlookApplication.ActiveExplorer
CBOutlookItems
m_OutlookApplication.ActiveExplorer.CurrentFolder
End If

ResumeHandler:
' Hide Start Screen
frmStartScreen.Hide
Unload frmStartScreen

Set oNameSpace = Nothing
Set oDataAccessor = Nothing
Exit Sub

ErrHandler:
Err.Source = "InitHandler"
ReportAndLogError Err
Resume ResumeHandler
End Sub
-------------------------------------------------------------------------------
 
S

Steven

I've looked Disabled Items but there wasn't my Addin....!!
In another test I've installed my Addin with Outlook XP SP2. After this I
didn't synchronize my Outlook XP with the exchange server. Then I updated to
Outlook 2003 SP1. In this situation my Addin worked. ThenI synchronized
outlook with the exchange server. After an outlook 2003 restart the addin
didn't worked again... :-((
 
K

Ken Slovak - [MVP - Outlook]

Can you get any other events from Outlook 2003 if you handle one of the
built-in events in the ThisOutlookSession class module? I haven't seen any
specific problems with my addins developed on Outlook 2000 running on
Outlook 2002 or 2003 on my own Exchange server as long I take care about the
restricted properties and methods.

Any settings on the Exchange server or the Outlook security form in Public
Folders that might be a problem? If you are using the security form what
folder is it in?

How about if you disable any McAfee integration with Outlook, does that
help? Also, check in the Application log of the Windows event logs just to
make sure you aren't getting any application crashes logged there.
 
G

Guest

delete it from the com add-in manager, close outlook,
unregister your dll manually
and then register it again manually.

some windows magic that helped for me.


john
Opusflow
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top