Outlook didn't load COM Addin

S

Steven

Hi folks!
I've had some problems with my COM Addin (VB6). If I choose under
extras/options/advanced options "Outlook Today" as the Folder at program
start my COM Addin won't be loaded at the next Outlook start. If I choose
another startup folder my COM Addin works at the next Outlook start. Does
anyone know what the problem is?
Thanks a lot.
Steven
 
K

Ken Slovak

Not from that information. Show your On_Connection code. Also, have you
tried debugging and seeing if On_Connection fires and where things go wrong?
The specific startup folder shouldn't matter at all, it's just a MAPIFolder
(even Outlook Today).
 
S

Steven

I've debugged my code and here is the real problem:
I use little bit different task forms. When 'Outlook Today' is the startup
folder and if there are one or more tasks without any date (duedate,
reminderdate,..) then my COM Addin wasn't loaded. The On_Connection Code was
never reached!! If I tried this with Outlook XP and it's no problem. With the
standard Outlook 2003 task form: it's no problem
If I customize my Outlook Today page and disable 'Include tasks with no due
date' and enable 'Today's tasks': it's no problem
If I create an task with my form having an duedate for example: it's no
problem
Does anyone know the problem?
Has something changed from Outlook XP to 2003 with the 'Outlook Today' Page
and the shown tasks?

Thanks a lot.
Stevan
 
K

Ken Slovak

Outlook Today is subject to more security restrictions in Outlook 2003 than
earlier, but I haven't seen or heard of the problem you mention. It's weird
but no weirder than some other Outlook oddities I guess. If that's what's
happening I really don't know of a solution for the problem if you aren't
even getting an On_Connection event.
 
S

Steven

Thanks, Ken.
BUT:
Now I know the problem: My Task form
In my Task form I've got some VBS Code. It's only like a dispatcher for
every function OnItemWrite, OnItemRead, ... there is a small Code in my form
calling a function in my Addin. If the Outlook Today page is built up the
function OnItemRead was called. At this moment there a no initialized Addin
In Outlook 2003 and the function call crashed. After this the Addin wasn't
loaded anymore. I think the order of creating Outlook Today and loading Addin
was changed from Outlook XP to Outlook 2003 (because with Outlook 2000 and XP
it worked). Could this a problem of my code: I still use the
IDTExtensibility2_... functions instead of the AddinInstance_... functions?
Is there a way to avoid my problems??

Steven
 
K

Ken Slovak

I don't know if they changed the sequence of how things are done but if the
Outlook Today page is firing Item_Read for those tasks before the addin is
connected then obviously things will fail. Since you can't change how
Outlook works you'll have to put code in Item_Read to check for the addin
and gracefully avoid the problem if the addin isn't connected or change the
code handling in your form.

IDTExtensibility2 is correct.
 
S

Steven

Hi Ken!

I've tried to check my Addin in the Item_Read function in the task form. But
I've got the problem that I can't determine if the addin has been loaded. I
tried to check the condition "...if Application.COMAddins("MyAddin").object
is nothing then...". I can check this condition but everytime I got an error
"424 object required". After this error the addin wasn't loaded...!!! Is
there a way to check if the addin is loaded without this error?? What's the
reason that the addin wasn't loaded after this error?

Steven
 
K

Ken Slovak

Are you handling errors in your form code? I would break the code so it
wasn't using any extra dot operators on any one line and check for errors
along the way.

Dim colAddins
Dim objAddin

On Error Resume Next

Set colAddins = Application.COMAddins
If Err Then
'no collection - could check for Err.Number = 424 if you want.
Err.Clear
Else
Set objAddin = colAddins.Item("MyAddin")
If Err Then
'no addin object
Err.Clear
Else
If objAddin.Connect = True Then
'OK to run the code
Else
'not connected
Err.Clear
End If
End If
End If
 
S

Steven

Thanks for your code, Ken.

But it doesn't work. The property Connect is true when my Addin was still
uninitialized... So I get the same error: 424

Sorry... ;-)
 

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