A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Inspector Close Event is fired when spell checking is canceled.



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 27th 06, 01:40 PM posted to microsoft.public.outlook.program_vba
Arcady
external usenet poster
 
Posts: 11
Default Inspector Close Event is fired when spell checking is canceled.

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.

  #2  
Old December 27th 06, 02:33 PM posted to microsoft.public.outlook.program_vba
Arcady
external usenet poster
 
Posts: 11
Default Inspector Close Event is fired when spell checking is canceled.

Maybe we can count on the fact (which I observe) that when the "real" Close
event fires, inspector's window is already invisible ?
Does anybody know whether it is guaranteed ?


"Arcady" wrote:

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.

  #3  
Old December 27th 06, 03:54 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Inspector Close Event is fired when spell checking is canceled.

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.

--
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


"Arcady" wrote in message
...
Maybe we can count on the fact (which I observe) that when the "real"
Close
event fires, inspector's window is already invisible ?
Does anybody know whether it is guaranteed ?


"Arcady" wrote:

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.


  #4  
Old December 27th 06, 05:20 PM posted to microsoft.public.outlook.program_vba
Arcady
external usenet poster
 
Posts: 11
Default Inspector Close Event is fired when spell checking is canceled

Hi Ken,
Thanks for your reply.
I'm not sure I understand the case you are talking about.
I see that inspector's false close event is fired only when isWordMail =
false.
There is also a false item close event fired from a word editor after
sending is canceled (is that what you are talking about?).
That's why I was used to destroy my item related objects only in inspector
close (because once, there was no false inspector close events)

Anyway, it seems that your solution would not work on my machine: in the
scenario I have described, send is not fired at all.

I thought about two solutions (similar to yours):
(I store all open inspectors/items wrappers in a global list)
1. When isWordMail = false, item close event will set a itemCloseFlag and
inspector close event will set a inspCloseFlag. If one of the two events sees
that the other's flag is set, the release code will be called. This will work
if item close fires if and only if the item is really being closed (I think
it is true when isWordMail = false).
2. When inspector close event fires, I set a timer to fire every second. If
the timer sees that the window of the inspector is invisible (I get the hwnd
of the active window in on activate event and save it in inspector's wrapper)
it calls the release code.

What do you think about these solutions ?

Thanks.

"Ken Slovak - [MVP - Outlook]" wrote:

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.

--
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


"Arcady" wrote in message
...
Maybe we can count on the fact (which I observe) that when the "real"
Close
event fires, inspector's window is already invisible ?
Does anybody know whether it is guaranteed ?


"Arcady" wrote:

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.



  #5  
Old December 27th 06, 07:26 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Inspector Close Event is fired when spell checking is canceled

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

--
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


"Arcady" wrote in message
...
Hi Ken,
Thanks for your reply.
I'm not sure I understand the case you are talking about.
I see that inspector's false close event is fired only when isWordMail =
false.
There is also a false item close event fired from a word editor after
sending is canceled (is that what you are talking about?).
That's why I was used to destroy my item related objects only in inspector
close (because once, there was no false inspector close events)

Anyway, it seems that your solution would not work on my machine: in the
scenario I have described, send is not fired at all.

I thought about two solutions (similar to yours):
(I store all open inspectors/items wrappers in a global list)
1. When isWordMail = false, item close event will set a itemCloseFlag and
inspector close event will set a inspCloseFlag. If one of the two events
sees
that the other's flag is set, the release code will be called. This will
work
if item close fires if and only if the item is really being closed (I
think
it is true when isWordMail = false).
2. When inspector close event fires, I set a timer to fire every second.
If
the timer sees that the window of the inspector is invisible (I get the
hwnd
of the active window in on activate event and save it in inspector's
wrapper)
it calls the release code.

What do you think about these solutions ?

Thanks.


  #6  
Old December 28th 06, 02:35 PM posted to microsoft.public.outlook.program_vba
Arcady
external usenet poster
 
Posts: 11
Default Inspector Close Event is fired when spell checking is canceled

Hi Ken,
I see now that after the scenrio I have described occures, a false item
close event fires when closing the messages and choosing "cancel" when
prompted to save.
So my first idea won't work.

I'm trying my second solution.
Do you have any sample scenario when the inspector stays visible seconds
after the "real" inspector close event fires ?

Thanks,
Arcady.

"Ken Slovak - [MVP - Outlook]" wrote:

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

--
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


"Arcady" wrote in message
...
Hi Ken,
Thanks for your reply.
I'm not sure I understand the case you are talking about.
I see that inspector's false close event is fired only when isWordMail =
false.
There is also a false item close event fired from a word editor after
sending is canceled (is that what you are talking about?).
That's why I was used to destroy my item related objects only in inspector
close (because once, there was no false inspector close events)

Anyway, it seems that your solution would not work on my machine: in the
scenario I have described, send is not fired at all.

I thought about two solutions (similar to yours):
(I store all open inspectors/items wrappers in a global list)
1. When isWordMail = false, item close event will set a itemCloseFlag and
inspector close event will set a inspCloseFlag. If one of the two events
sees
that the other's flag is set, the release code will be called. This will
work
if item close fires if and only if the item is really being closed (I
think
it is true when isWordMail = false).
2. When inspector close event fires, I set a timer to fire every second.
If
the timer sees that the window of the inspector is invisible (I get the
hwnd
of the active window in on activate event and save it in inspector's
wrapper)
it calls the release code.

What do you think about these solutions ?

Thanks.



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Spell checking in English and Spanish Arturo Meneses Outlook - General Queries 0 August 26th 06 04:35 PM
What event gets fired when i show/hide my outlook toolbar Gautam Outlook and VBA 1 July 12th 06 03:21 PM
Inspector Close events not firing.. Sanjay Add-ins for Outlook 1 May 22nd 06 07:18 PM
Help! Inspector.Close is fired before Inspector.Activate handler finishes Sergey Anchipolevsky Add-ins for Outlook 8 February 9th 06 10:51 AM
Outlook 2003 fires an Inspector Close when a send is cancelled Steve D Add-ins for Outlook 8 February 9th 06 12:22 AM


All times are GMT +1. The time now is 08:48 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.