Inspector Close Event is fired when spell checking is canceled.

A

Arcady

Hi everyone,
I maintain an addin that listens to Inspector events.
When I receive the Close event, I disconnect from inspector events interface
and release all the references to the inspector (otherwise it will stay
alive).

Recently, I've encountered a scenario when the Close event is fired when the
inspector is not being actually closed:
1. Set Outlook to spell check each sent message(
Tools --> Options --> Spelling, check "Always check spelling before sending")
2. Set the message editor to outlook editor (not word)
3. Compose a new message and write some gibberish in the body
4. click "send"
5. When the spell checker pops-up, click cancel.
6. outlook will ask whether you like to send the message anyway - click no.

when you click "no", the close event will be fired.

After you perform these steps, many addins will stop working for the
inspector (Outlook Spy is one of them).
Probably because the addins release their reference to the inspector and
disconnect the events.

I have checked it with Outlook 2003 SP2.

Do you have any idea how to overcome this problem ? How to identify this
situation ?
When is the right time to release the inspector if not in Close event ?


Thank you in advance
for your suggestions.
Arcady.
 
K

Ken Slovak - [MVP - Outlook]

No, that's not guaranteed. Not only that but there's another case you
haven't considered. If WordMail is being used you have to account for the
time taken to reformat the document (email) if the Send is canceled.

The false close event seems to have come into play with an Outlook 2003
update, I first noticed it in the update that changed the version to
11.8010.

I set a flag if Item.Send is entered. At the end of .Send I enable a timer
for about .5 - 1 second. If the timer fires I clear that flag. If the flag
is set I ignore the first Inspector.Close and clear the flag in that event.
If MailItem.Close fires I call my release code and clear the flag.
 
K

Ken Slovak - [MVP - Outlook]

You can try them but I don't think that the Inspector would always not be
visible in all cases.
 
K

Ken Slovak - [MVP - Outlook]

If it's WordMail the email has to paginate before closing for any reason
(user closed or sent or whatever). Depending on the size of the email and
the speed of the computer the close event can fire and the Inspector window
can still be visible.
 

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