Outlook COM Add-In

Y

Yahya Saad

Dear All,

I developed a outlook 2000 COM add-in with VB6 and would like to trigger
an every time the outlook is closed, but I am facing a problem that the
below code is fired only the first time the outlook is closed since outlook
is remaining active in the memory.

Private Sub objExpl_Close()
If ObjApp.Explorers.Count <= 1 Then
If i > 0 Then
'Do something
End If
End If
End Sub

How can I either dispose the outlook when it is closed to be able to
trigger the close event the next time it is open or find a way to trigger
this event every time outlook 2000 is closed.
 
K

Ken Slovak - [MVP - Outlook]

You need to release all your Outlook objects before the On_Disconnection
event will fire and Outlook will fully close down. See the ItemsCB COM addin
sample (VB 6) for the best practices way to ensure your code won't hang
Outlook in memory and for workarounds for common bugs in Outlook COM addins.
 
Y

Yahya Saad

Thank you for your reply,
I wanted also to ask how can I stop the shutdown of the outlook till I run a
form and wait for the users response then continue the shutdown.

Regards,
Yahya Saad
 
K

Ken Slovak - [MVP - Outlook]

In your shutdown code open a form modally and the rest of your shutdown code
won't run until the modal form is closed.
 

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