Outlook won't close if there are any open Inspectors or Explorers. That
would keep it open.
You must check for any existing Explorers and Inspectors when an
Inspector.Close or Explorer.Close event fires, something like this:
Private Sub objExpl_Close()
On Error Resume Next
'Current Explorer is closing--update identity to ActiveExplorer
Set objExpl = objOutlook.ActiveExplorer
'if this is the last Explorer, then objExpl = Nothing -close down
If (objExpl Is Nothing) And (objOutlook.Inspectors.Count = 0) Then
UnInitHandler
End If
End Sub
Private Sub objInsp_Close()
On Error Resume Next
Set objInsp = objOutlook.ActiveInspector
If objOutlook.Explorers.Count = 0 And objOutlook.Inspectors.Count = 1
Then
UnInitHandler
End If
End Sub
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"donald" wrote in message
ups.com...
Hi Ken,
Thanks for your reply.
I basic don't know outlook to close and my COM add-in to close if there
are any Inspector Open?
How would i do about doing this?
Thanks
Donald