How can I catch a message after its been sent out?

  • Thread starter Thread starter Jason Kontkanen
  • Start date Start date
J

Jason Kontkanen

Hello,

I'm modifying my existing addin. After an item is sent out, I need to take
the message and create a PDF from it. The PDF conversion isn't the problem,
I can handle that fine. At any rate, the problem I'm seeing is simply that
using the _ItemSend event of the outlook application object doesn't seem to
have a complete message object. It seems to be missing the From
information, both in the message (I save it as a document to do the
conversion) and the object doesn't have any sender information attached.
Using the same functions, everything is fine on mails already sent out, but
I just can't get it while one is being sent out. I suppose I could try to
capture the message ID and then later go through the sent items to try to
find it, but that just seems like a nasty hack.

This needs to work for Outlook 2000 and above.

Any pointers would be appreciated
Thanks,
Jason
 
Your analysis is correct. Until the message is actually delivered to the upstream server and is placed in the Sent Items folder, the sender and sending time information is not available. You will need to monitor the Sent Items folder with the MAPIFolder.Items.ItemAdd method. No nasty hack necessary: Just put a unique value in the BillingInformation or Mileage property that identifes the message as that your add-in needs to process.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Sue,

Thanks for the pointer. I'll look into that.

Jason

Your analysis is correct. Until the message is actually delivered to the
upstream server and is placed in the Sent Items folder, the sender and
sending time information is not available. You will need to monitor the Sent
Items folder with the MAPIFolder.Items.ItemAdd method. No nasty hack
necessary: Just put a unique value in the BillingInformation or Mileage
property that identifes the message as that your add-in needs to process.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top