Outlook MailItem Close Event - VS2005 - where has it gone?

H

hayrob

Outlook reference tells us that there is a MailItem Close Event. When I try
to add a handler for it in VS 2005, Intellisense tells me that it is not
there! Where has it gone?
 
T

TesInSI

I have the same problem with VS2003 and the Office XP PIAs. MailItem
implements _MailItem and _ItemEvents<can't remember the rest> which contains
the close event. I can access everthing in MailItem except for the Close
event. MailItemClass DOES contain a working close event BUT when I cast to
MailItemClass my addins silently fail in Outlook and I never see my buttons
or any code after I try to cast to MailItemClass. I change a couple of lines
to read MailItem and all is well except there is no Close event.

To be clear MailItemClass works on my test machines at home with the same
PIA versions and Windows, .Net and Office configurations with the exception
being that I am on Exchange at work and Internet at home. At work,
MailItemClass does nothing. I don't even get an error message. It just runs
up until I try to cast to MailItemClass.

I'm frustrated because my MailItem wrapper works fine for single items
opened in one window at a time since I can catch the Inspector close event
and do clean up. The problem is if a user navigates through several messages
in one window using the Next and Previous buttons then I don't get the
MailItem Close event and I can't do any real clean up unless my button is
pressed which then does the cleanup.
 

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