Inspector Close events not firing..

  • Thread starter Thread starter Sanjay
  • Start date Start date
S

Sanjay

Hello --
I have noticed that the Inspector_Close event does not fire if
Outlook is configured to "Close original message on reply or forward".
I am using VSTO with Outlook 2k3. With the above setting set in
Tools >> Options >> Email Options. When we hit reply, a new inspector
event is fired but the close event of the inspector of the original
message is not fired. All those closes are then fired when you quit
the application. I was under the impression that Outlook would simply
reuse the inspector but it seems it is creating a new inspector for the
response and then closes the inspector for the original message without
firing the inspector_close event.
I have cleanup code in this event.
 
The original Inspector is not really closed, it's hidden. So the Close event
isn't firing until Outlook itself is being closed. If your cleanup code
properly handles Inspector.Close it shouldn't matter in terms of releasing
your Outlook objects. You can always trap MailItem.Close, which will fire in
your case and if needed you can force the Inspector to close from the
MailItem.Close event handler.
 
Back
Top