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.