Outlook 2003 Inspector Close Event problem???

S

Scott McBurney

I have been able to reproduce a problem in my COM addin for Outlook.

A user opens an email message, and I get a reference to the inspector.

Later, the user clicks Reply or Forward, edits the new message, and sends
it. When the inspector closes, it never fires the inspector_close event.

Any ideas why this is happening and if it is possible to get the close
event? Since I don't get the close event, I'm hanging on to the inspector
reference and it is causing problems with other addins.

Reproduced using Outlook 2003 SP1 (11.6359.6360)
 
K

Ken Slovak - [MVP - Outlook]

Whether or not you get Inspector.Close when reply, forward or even send is
used depends on the Outlook version and whether or not WordMail is being
used. The Item.Close and Inspector.Close may or may not fire and may fire in
different orders.

What I usually do is handle both Close events and check to see in both if my
close code has run already. If not I run it from that Close event.

I also explicitly close the Inspector in the Item.Send event, to guarantee
that Inspector.Close will fire:

Private Sub m_objMail_Send(Cancel As Boolean)
'whatever else needs to be done

If m_blnWord Then
safInspector.WordEditor.Close wdDoNotSaveChanges
Else
m_objInsp.Close olDiscard
End If
End Sub

If that sort of thing isn't done and WordMail is running you'd end up with a
blank "ghost" Word document window just sitting there after the Inspector
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