Thanks again for your reply.
I realize that I used loop instead of
loop-waiting-only-for-a-window-to-be-closed, which is another way of
describing a modal window. ;o)
What are your thoughts about using " objMailItem.Display Modal:=True "
in an Excel class module and then simply return whether the MailItem
Send event fired or not ?
Just to recall the context: I only want to build OL mail items from
inside an Excel application, display each one to the user and record
whether or not he actually sent it as the mail window is closed..
Since I'm mostly an Excel and Access developer, I'm not very familiar
with Outlook gotchas, but having to implement and use the Item's
Inspector object only for that purpose seems a little overkill to me.
Am I missing something ? Any gotchas ?
Thanks
Ken Slovak - [MVP - Outlook] a pensé très fort :
Sorry, that was a typo with www.outlookcode.com.
The problem I see with a loop is that it may become infinite. Then the code
is essentially locking up your computer. If I was to use a loop I'd condition
it with a flag that was set before entering the loop and cleared when any of
the relevant events was fired. That way at least you'd know when to terminate
the loop.
In some versions of Outlook you can get an Inspector.Close and not an
Item.Close depending on whether WordMail is being used and if Send is fired.
As I recall there are a couple of other obscure cases but I haven't played
with that for a long time since my template code always handles both Close
events, so I haven't needed to determine the cases in a while. Your mileage
may vary.
--
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
"Michel S." wrote in message
...