Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Outlook Add in 2003 fails to load

Geek News

Outlook Add in 2003 fails to load
Andrew 10/15/2008 9:53:00 PM
I have an outlook add-in for 2003 which works fine when Outlook is launched
by the user. However, when an external program such Active Sync launches the
outlook process, the add-in's load behaviour in the registry changes to 2 and
does not change back when the Outlook is launched again by the user. To fix
the problem I have to go to the registry and change the load behaviour back
to 3 or click repair in the "Add/Remove" programs for the add-in. Is there
any way to get around this problem. I know in Outlook 2007 that does not
happen because I also developed the add-in for it.

Thanks,
Andrew
Re: Outlook Add in 2003 fails to load
"Peter Foldes" <okf22[ at ]hotmail.com> 10/15/2008 10:41:46 PM
If you developed that Add-In also for Office 2007 then you as the developer for that Add-In should know and find the answer to that issue in Office 2003 that you are posting about.

Have no idea about your Add-in and what it does and what it is

--
Peter

Please Reply to Newsgroup for the benefit of others
Requests for assistance by email can not and will not be acknowledged.

"Andrew" <Andrew[ at ]discussions.microsoft.com> wrote in message news:D847769A-4C1A-4432-B43D-51293045B7E1[ at ]microsoft.com...
[Quoted Text]
>I have an outlook add-in for 2003 which works fine when Outlook is launched
> by the user. However, when an external program such Active Sync launches the
> outlook process, the add-in's load behaviour in the registry changes to 2 and
> does not change back when the Outlook is launched again by the user. To fix
> the problem I have to go to the registry and change the load behaviour back
> to 3 or click repair in the "Add/Remove" programs for the add-in. Is there
> any way to get around this problem. I know in Outlook 2007 that does not
> happen because I also developed the add-in for it.
>
> Thanks,
> Andrew
Re: Outlook Add in 2003 fails to load
Andrew 10/16/2008 1:01:01 PM
The code for the add-in in both versions are very similar, however, the
changes made by Microsoft between the two versions of Office are dramatic. A
significant portion of the issues I experienced in developing for 2003 were
non-existent for 2007. Needless to say, what my add-in does has very
little(in my opinion) with whether Outlook determines it should be loaded.
That is, the StartUp event that the Object model exposes to code against
Outlook, isn't being hit when the load behaviour changes. That is where the
issue is, if you believe more information of what the add-in does, would
allow for a more informative response then I can do that.

Regards,
Andrew

"Peter Foldes" wrote:

[Quoted Text]
> If you developed that Add-In also for Office 2007 then you as the developer for that Add-In should know and find the answer to that issue in Office 2003 that you are posting about.
>
> Have no idea about your Add-in and what it does and what it is
>
> --
> Peter
>
> Please Reply to Newsgroup for the benefit of others
> Requests for assistance by email can not and will not be acknowledged.
>
> "Andrew" <Andrew[ at ]discussions.microsoft.com> wrote in message news:D847769A-4C1A-4432-B43D-51293045B7E1[ at ]microsoft.com...
> >I have an outlook add-in for 2003 which works fine when Outlook is launched
> > by the user. However, when an external program such Active Sync launches the
> > outlook process, the add-in's load behaviour in the registry changes to 2 and
> > does not change back when the Outlook is launched again by the user. To fix
> > the problem I have to go to the registry and change the load behaviour back
> > to 3 or click repair in the "Add/Remove" programs for the add-in. Is there
> > any way to get around this problem. I know in Outlook 2007 that does not
> > happen because I also developed the add-in for it.
> >
> > Thanks,
> > Andrew
>
Re: Outlook Add in 2003 fails to load
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 10/16/2008 2:02:20 PM
Is it just being disabled from loading or is it actually being disabled by
Outlook (where it would show up in the Disabled Items list)?

Most likely if LoadBehavior is just being set to 2 and the addin isn't being
disabled you're receiving an error and not handling it.

Now when ActiveSync or other such software starts Outlook it's starting it
in what's called "headless" mode, where there are no Explorers or Inspectors
(no UI). So how is your code handling that condition? Are you instantiating
an Inspectors collection and an Explorers collection and handlers for the
NewInspector() and NewExplorer() events? Those would tell you when UI was
added to Outlook.

You also need to tell us more about your code.

What language?

Are you using a different solution with the correct Outlook version
references?

Have you simulated an ActiveSync startup and run your code in the debugger?

Are you logging and receiving any errors?

What is your startup code?

Do you hit your OnConnection or Startup event handlers?

If it's managed code are you receiving any Fusion loader errors when your
addin is started up in that way?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Andrew" <Andrew[ at ]discussions.microsoft.com> wrote in message
news:D847769A-4C1A-4432-B43D-51293045B7E1[ at ]microsoft.com...
[Quoted Text]
>I have an outlook add-in for 2003 which works fine when Outlook is launched
> by the user. However, when an external program such Active Sync launches
> the
> outlook process, the add-in's load behaviour in the registry changes to 2
> and
> does not change back when the Outlook is launched again by the user. To
> fix
> the problem I have to go to the registry and change the load behaviour
> back
> to 3 or click repair in the "Add/Remove" programs for the add-in. Is there
> any way to get around this problem. I know in Outlook 2007 that does not
> happen because I also developed the add-in for it.
>
> Thanks,
> Andrew

Re: Outlook Add in 2003 fails to load
Andrew 10/16/2008 2:38:01 PM
It was hanlding the error, but that still changed the loadbehaviour to "2",
so I added this, "If Exists(m_olOutlookApplication.ActiveExplorer) Then"
with the hope that preventing the error from happening may solve the problem.

VS 2005 SE(Visual Basic) are the development environment and language

This is instantiated in the "ThisApplication" class which hooks the
"StartUp" event. oAddIn = New OutlookAddIn(Me) and passed to the class below.

Public Sub New(ByVal oApp As ThisApplication)
Try
m_olOutlookApplication = oApp
m_olInspectors = m_olOutlookApplication.Inspectors
m_olExplorers = m_olOutlookApplication.Explorers
If Exists(m_olOutlookApplication.ActiveExplorer) Then
m_olContactFolder =
m_olOutlookApplication.ActiveExplorer.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)
olContactFolder = m_olContactFolder
'm_olContactFolderItems = m_olContactFolder.Items
m_butNewEmailSyncToCS = Nothing
m_butNewEmailSendSyncToCS = Nothing

CreateMainCSToolbar()
CreateClientSpaceProperty()
AddSyncedCompNames()
Else
Return
End If
'Automatic_Login()
Catch ex As Exception
MsgBox("OutlookAddIn failed to initialize:" & vbCrLf & vbCrLf &
ex.Message)
Finally
End Try
End Sub

The add-in isn't really being disabled as you assume, the loadbehaviour is
just being set to "2" To debug the code, I usually just hit the run button
and visual studio launches outlook. This method don't produce the desired
results because I assume VS "handles" the problems. I usually deploy the msi
to another test machine to ensure its working as expected.

Andrew

"Ken Slovak - [MVP - Outlook]" wrote:

[Quoted Text]
> Is it just being disabled from loading or is it actually being disabled by
> Outlook (where it would show up in the Disabled Items list)?
>
> Most likely if LoadBehavior is just being set to 2 and the addin isn't being
> disabled you're receiving an error and not handling it.
>
> Now when ActiveSync or other such software starts Outlook it's starting it
> in what's called "headless" mode, where there are no Explorers or Inspectors
> (no UI). So how is your code handling that condition? Are you instantiating
> an Inspectors collection and an Explorers collection and handlers for the
> NewInspector() and NewExplorer() events? Those would tell you when UI was
> added to Outlook.
>
> You also need to tell us more about your code.
>
> What language?
>
> Are you using a different solution with the correct Outlook version
> references?
>
> Have you simulated an ActiveSync startup and run your code in the debugger?
>
> Are you logging and receiving any errors?
>
> What is your startup code?
>
> Do you hit your OnConnection or Startup event handlers?
>
> If it's managed code are you receiving any Fusion loader errors when your
> addin is started up in that way?
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
>
>
> "Andrew" <Andrew[ at ]discussions.microsoft.com> wrote in message
> news:D847769A-4C1A-4432-B43D-51293045B7E1[ at ]microsoft.com...
> >I have an outlook add-in for 2003 which works fine when Outlook is launched
> > by the user. However, when an external program such Active Sync launches
> > the
> > outlook process, the add-in's load behaviour in the registry changes to 2
> > and
> > does not change back when the Outlook is launched again by the user. To
> > fix
> > the problem I have to go to the registry and change the load behaviour
> > back
> > to 3 or click repair in the "Add/Remove" programs for the add-in. Is there
> > any way to get around this problem. I know in Outlook 2007 that does not
> > happen because I also developed the add-in for it.
> >
> > Thanks,
> > Andrew
>
>
Re: Outlook Add in 2003 fails to load
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 10/16/2008 2:50:51 PM
So it's a VSTO addin then.

You can also check for Explorers.Count > 0 rather than using ActiveExplorer.
Then if you have a NewExplorer handler you would then instantiate your other
objects in that handler if you weren't already instantiated.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Andrew" <Andrew[ at ]discussions.microsoft.com> wrote in message
news:A6D6EEEF-2A69-4D8E-BBA4-107867ED6EC6[ at ]microsoft.com...
[Quoted Text]
> It was hanlding the error, but that still changed the loadbehaviour to
> "2",
> so I added this, "If Exists(m_olOutlookApplication.ActiveExplorer) Then"
> with the hope that preventing the error from happening may solve the
> problem.
>
> VS 2005 SE(Visual Basic) are the development environment and language
>
> This is instantiated in the "ThisApplication" class which hooks the
> "StartUp" event. oAddIn = New OutlookAddIn(Me) and passed to the class
> below.
>
> Public Sub New(ByVal oApp As ThisApplication)
> Try
> m_olOutlookApplication = oApp
> m_olInspectors = m_olOutlookApplication.Inspectors
> m_olExplorers = m_olOutlookApplication.Explorers
> If Exists(m_olOutlookApplication.ActiveExplorer) Then
> m_olContactFolder =
> m_olOutlookApplication.ActiveExplorer.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)
> olContactFolder = m_olContactFolder
> 'm_olContactFolderItems = m_olContactFolder.Items
> m_butNewEmailSyncToCS = Nothing
> m_butNewEmailSendSyncToCS = Nothing
>
> CreateMainCSToolbar()
> CreateClientSpaceProperty()
> AddSyncedCompNames()
> Else
> Return
> End If
> 'Automatic_Login()
> Catch ex As Exception
> MsgBox("OutlookAddIn failed to initialize:" & vbCrLf & vbCrLf &
> ex.Message)
> Finally
> End Try
> End Sub
>
> The add-in isn't really being disabled as you assume, the loadbehaviour is
> just being set to "2" To debug the code, I usually just hit the run button
> and visual studio launches outlook. This method don't produce the desired
> results because I assume VS "handles" the problems. I usually deploy the
> msi
> to another test machine to ensure its working as expected.
>
> Andrew

Re: Outlook Add in 2003 fails to load
Andrew 10/16/2008 3:06:01 PM
To eliminate bad code as being the possible reason, I commented out the
"oAddIn = New OutlookAddIn(Me)" code in the start up event and Outlook still
changed the loadbehaviour to "2" I believe that its a possible .NET Framework
2.0 Security Configuration hole that isn't being covered up. What do you
think?

Andrew

"Ken Slovak - [MVP - Outlook]" wrote:

[Quoted Text]
> So it's a VSTO addin then.
>
> You can also check for Explorers.Count > 0 rather than using ActiveExplorer.
> Then if you have a NewExplorer handler you would then instantiate your other
> objects in that handler if you weren't already instantiated.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
>
>
> "Andrew" <Andrew[ at ]discussions.microsoft.com> wrote in message
> news:A6D6EEEF-2A69-4D8E-BBA4-107867ED6EC6[ at ]microsoft.com...
> > It was hanlding the error, but that still changed the loadbehaviour to
> > "2",
> > so I added this, "If Exists(m_olOutlookApplication.ActiveExplorer) Then"
> > with the hope that preventing the error from happening may solve the
> > problem.
> >
> > VS 2005 SE(Visual Basic) are the development environment and language
> >
> > This is instantiated in the "ThisApplication" class which hooks the
> > "StartUp" event. oAddIn = New OutlookAddIn(Me) and passed to the class
> > below.
> >
> > Public Sub New(ByVal oApp As ThisApplication)
> > Try
> > m_olOutlookApplication = oApp
> > m_olInspectors = m_olOutlookApplication.Inspectors
> > m_olExplorers = m_olOutlookApplication.Explorers
> > If Exists(m_olOutlookApplication.ActiveExplorer) Then
> > m_olContactFolder =
> > m_olOutlookApplication.ActiveExplorer.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)
> > olContactFolder = m_olContactFolder
> > 'm_olContactFolderItems = m_olContactFolder.Items
> > m_butNewEmailSyncToCS = Nothing
> > m_butNewEmailSendSyncToCS = Nothing
> >
> > CreateMainCSToolbar()
> > CreateClientSpaceProperty()
> > AddSyncedCompNames()
> > Else
> > Return
> > End If
> > 'Automatic_Login()
> > Catch ex As Exception
> > MsgBox("OutlookAddIn failed to initialize:" & vbCrLf & vbCrLf &
> > ex.Message)
> > Finally
> > End Try
> > End Sub
> >
> > The add-in isn't really being disabled as you assume, the loadbehaviour is
> > just being set to "2" To debug the code, I usually just hit the run button
> > and visual studio launches outlook. This method don't produce the desired
> > results because I assume VS "handles" the problems. I usually deploy the
> > msi
> > to another test machine to ensure its working as expected.
> >
> > Andrew
>
>
Re: Outlook Add in 2003 fails to load
Dave Vespa [MSFT] 10/16/2008 6:10:01 PM
Hi Andrew,

What it sounds like to me is that you are running into a bug in the original
VSTO 2005 SE which disabled Outlook 2003 VSTO solutions when Outlook was
launched in "headless" mode. Make sure you have the latest version of the
VSTO 2005 SE runtime installed. You can get the latest version here:
http://www.microsoft.com/downloads/details.aspx?familyid=8315654B-A5AE-4108-B7FC-186402563F2B&displaylang=en

"Andrew" wrote:

[Quoted Text]
> To eliminate bad code as being the possible reason, I commented out the
> "oAddIn = New OutlookAddIn(Me)" code in the start up event and Outlook still
> changed the loadbehaviour to "2" I believe that its a possible .NET Framework
> 2.0 Security Configuration hole that isn't being covered up. What do you
> think?
>
> Andrew
>
> "Ken Slovak - [MVP - Outlook]" wrote:
>
> > So it's a VSTO addin then.
> >
> > You can also check for Explorers.Count > 0 rather than using ActiveExplorer.
> > Then if you have a NewExplorer handler you would then instantiate your other
> > objects in that handler if you weren't already instantiated.
> >
> > --
> > Ken Slovak
> > [MVP - Outlook]
> > http://www.slovaktech.com
> > Author: Professional Programming Outlook 2007.
> > Reminder Manager, Extended Reminders, Attachment Options.
> > http://www.slovaktech.com/products.htm
> >
> >
> > "Andrew" <Andrew[ at ]discussions.microsoft.com> wrote in message
> > news:A6D6EEEF-2A69-4D8E-BBA4-107867ED6EC6[ at ]microsoft.com...
> > > It was hanlding the error, but that still changed the loadbehaviour to
> > > "2",
> > > so I added this, "If Exists(m_olOutlookApplication.ActiveExplorer) Then"
> > > with the hope that preventing the error from happening may solve the
> > > problem.
> > >
> > > VS 2005 SE(Visual Basic) are the development environment and language
> > >
> > > This is instantiated in the "ThisApplication" class which hooks the
> > > "StartUp" event. oAddIn = New OutlookAddIn(Me) and passed to the class
> > > below.
> > >
> > > Public Sub New(ByVal oApp As ThisApplication)
> > > Try
> > > m_olOutlookApplication = oApp
> > > m_olInspectors = m_olOutlookApplication.Inspectors
> > > m_olExplorers = m_olOutlookApplication.Explorers
> > > If Exists(m_olOutlookApplication.ActiveExplorer) Then
> > > m_olContactFolder =
> > > m_olOutlookApplication.ActiveExplorer.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)
> > > olContactFolder = m_olContactFolder
> > > 'm_olContactFolderItems = m_olContactFolder.Items
> > > m_butNewEmailSyncToCS = Nothing
> > > m_butNewEmailSendSyncToCS = Nothing
> > >
> > > CreateMainCSToolbar()
> > > CreateClientSpaceProperty()
> > > AddSyncedCompNames()
> > > Else
> > > Return
> > > End If
> > > 'Automatic_Login()
> > > Catch ex As Exception
> > > MsgBox("OutlookAddIn failed to initialize:" & vbCrLf & vbCrLf &
> > > ex.Message)
> > > Finally
> > > End Try
> > > End Sub
> > >
> > > The add-in isn't really being disabled as you assume, the loadbehaviour is
> > > just being set to "2" To debug the code, I usually just hit the run button
> > > and visual studio launches outlook. This method don't produce the desired
> > > results because I assume VS "handles" the problems. I usually deploy the
> > > msi
> > > to another test machine to ensure its working as expected.
> > >
> > > Andrew
> >
> >
Re: Outlook Add in 2003 fails to load
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 10/16/2008 7:09:35 PM
From the sound of it I'd agree with Dave and I'd check that out first. I
forgot about that bug until he mentioned it.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Andrew" <Andrew[ at ]discussions.microsoft.com> wrote in message
news:8DD33578-FC92-4F84-A1D4-45A88DAC2ABC[ at ]microsoft.com...
[Quoted Text]
> To eliminate bad code as being the possible reason, I commented out the
> "oAddIn = New OutlookAddIn(Me)" code in the start up event and Outlook
> still
> changed the loadbehaviour to "2" I believe that its a possible .NET
> Framework
> 2.0 Security Configuration hole that isn't being covered up. What do you
> think?
>
> Andrew

Re: Outlook Add in 2003 fails to load
Andrew 10/16/2008 8:35:03 PM
Hey Dave,

You were right, my first development machine for the 2003 add-in was set up
to deploy the interops and vstoruntime files, but I didn't set up my new
machine to do that. After I completed that and ran the setup.exe file on the
test machine, it installed the interops and vstoruntime. Now launching
outlook in "headless" mode does not change the loadbehaviour. Thanks a lot
guys :)

Andrew

"Dave Vespa [MSFT]" wrote:

[Quoted Text]
> Hi Andrew,
>
> What it sounds like to me is that you are running into a bug in the original
> VSTO 2005 SE which disabled Outlook 2003 VSTO solutions when Outlook was
> launched in "headless" mode. Make sure you have the latest version of the
> VSTO 2005 SE runtime installed. You can get the latest version here:
>
> http://www.microsoft.com/downloads/details.aspx?familyid=8315654B-A5AE-4108-B7FC-186402563F2B&displaylang=en
>
> "Andrew" wrote:
>
> > To eliminate bad code as being the possible reason, I commented out the
> > "oAddIn = New OutlookAddIn(Me)" code in the start up event and Outlook still
> > changed the loadbehaviour to "2" I believe that its a possible .NET Framework
> > 2.0 Security Configuration hole that isn't being covered up. What do you
> > think?
> >
> > Andrew
> >
> > "Ken Slovak - [MVP - Outlook]" wrote:
> >
> > > So it's a VSTO addin then.
> > >
> > > You can also check for Explorers.Count > 0 rather than using ActiveExplorer.
> > > Then if you have a NewExplorer handler you would then instantiate your other
> > > objects in that handler if you weren't already instantiated.
> > >
> > > --
> > > Ken Slovak
> > > [MVP - Outlook]
> > > http://www.slovaktech.com
> > > Author: Professional Programming Outlook 2007.
> > > Reminder Manager, Extended Reminders, Attachment Options.
> > > http://www.slovaktech.com/products.htm
> > >
> > >
> > > "Andrew" <Andrew[ at ]discussions.microsoft.com> wrote in message
> > > news:A6D6EEEF-2A69-4D8E-BBA4-107867ED6EC6[ at ]microsoft.com...
> > > > It was hanlding the error, but that still changed the loadbehaviour to
> > > > "2",
> > > > so I added this, "If Exists(m_olOutlookApplication.ActiveExplorer) Then"
> > > > with the hope that preventing the error from happening may solve the
> > > > problem.
> > > >
> > > > VS 2005 SE(Visual Basic) are the development environment and language
> > > >
> > > > This is instantiated in the "ThisApplication" class which hooks the
> > > > "StartUp" event. oAddIn = New OutlookAddIn(Me) and passed to the class
> > > > below.
> > > >
> > > > Public Sub New(ByVal oApp As ThisApplication)
> > > > Try
> > > > m_olOutlookApplication = oApp
> > > > m_olInspectors = m_olOutlookApplication.Inspectors
> > > > m_olExplorers = m_olOutlookApplication.Explorers
> > > > If Exists(m_olOutlookApplication.ActiveExplorer) Then
> > > > m_olContactFolder =
> > > > m_olOutlookApplication.ActiveExplorer.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)
> > > > olContactFolder = m_olContactFolder
> > > > 'm_olContactFolderItems = m_olContactFolder.Items
> > > > m_butNewEmailSyncToCS = Nothing
> > > > m_butNewEmailSendSyncToCS = Nothing
> > > >
> > > > CreateMainCSToolbar()
> > > > CreateClientSpaceProperty()
> > > > AddSyncedCompNames()
> > > > Else
> > > > Return
> > > > End If
> > > > 'Automatic_Login()
> > > > Catch ex As Exception
> > > > MsgBox("OutlookAddIn failed to initialize:" & vbCrLf & vbCrLf &
> > > > ex.Message)
> > > > Finally
> > > > End Try
> > > > End Sub
> > > >
> > > > The add-in isn't really being disabled as you assume, the loadbehaviour is
> > > > just being set to "2" To debug the code, I usually just hit the run button
> > > > and visual studio launches outlook. This method don't produce the desired
> > > > results because I assume VS "handles" the problems. I usually deploy the
> > > > msi
> > > > to another test machine to ensure its working as expected.
> > > >
> > > > Andrew
> > >
> > >

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net