View Single Post
  #7  
Old April 19th 07, 08:01 PM posted to microsoft.public.outlook.program_vba
Robert Morley
external usenet poster
 
Posts: 9
Default MailItem Close Event

A-ha!

Okay, after poking around a bit, I've determined that what I need to do is
to monitor the Inspector's Close event, not the MailItem's Close event.
That will tell me deterministically when the window has been closed, and
from that point, I can determine what actually happened to the item by
looking at its Saved property, which will be either True, False, or raise an
error if the item has been sent successfully.

Thanks for trying to help me out. I appreciate your efforts.



Rob

"Michael Bauer [MVP - Outlook]" wrote in message
news


Simply do not process anythign in the MailItem's Close event, but wait for
one of the other events.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - Categorize Outlook data:
http://www.vboffice.net/product.html...&lang=en&pub=6

Am Thu, 19 Apr 2007 01:29:19 -0400 schrieb Robert Morley:

But what's happening is that the Close event is firing *before* the
Yes/No/Cancel question is answered. So if the user says Cancel, then

sends
the message, I've already processed the Close event. How can I tell,

either
during the Close event or immediately afterwards, whether the message was
actually closed or if it's still on-screen?


Rob

"Michael Bauer [MVP - Outlook]" wrote in message
...


You will get either the MailItem's Send event or its Inspector's Close
event.

Another possibility is that the user deletes the message. Then the
MailItem's BeforeDelete fires after the user had the chance to cancel.
That
event is available sinve OL XP.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - Categorize Outlook data:

http://www.vboffice.net/product.html...&lang=en&pub=6

Am Wed, 18 Apr 2007 16:04:53 -0400 schrieb Robert Morley:

Hi all,

I have a MailItem object (technically via Redemption, but as far as I

can
tell, it works the same with the "normal" object library as well),
which
I'm
displaying on screen with the Display method. I'm monitoring the Close
event to determine if the message is not being sent. I need to find

some
way of determining whether the user has clicked Cancel to the "Do you
want
to save changes?" dialog and the message is really still open. Is
there
some way I can do this? I've looked around most of the properties,
including the various GetInspector properties, and I can't seem to find
ANYTHING that's different whether I click "Cancel" or "No" when

prompted.

Or better yet, is there an easy way to open an object with Display,
then
determine when the message has been finalized (i.e., sent or truly
closed)?



Thanks,
Rob



Ads