Outlook COM Add-In

  • Thread starter Thread starter Yahya Saad
  • Start date Start date
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.
 
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.
 
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
 
In your shutdown code open a form modally and the rest of your shutdown code
won't run until the modal form is closed.
 
Back
Top