Capturing the Message Body on Send of the email.

  • Thread starter Thread starter TrussworksLeo
  • Start date Start date
T

TrussworksLeo

Hello,

I was wondering if someone could send me in the right direction.

I have a VB.Net app that opens an email add the sender and adds attachments
to it.

I would like to be able to either save the message or save the txt in the
body of the message to a file on the file system with other files related to
the purpose of the email. (I know how to do the file system operations once I
get access to the message body)

My App instantiated the message so I should have access to the on send event
correct?

Where do I begin?

I have Sue Moshers book on Outlook 2007 Programming but nothing quite fits.
 
Is this message created using the Outlook object model? If you have the
message as a MailItem object then save it and read the Body or HTMLBody
properties.

If you want to wait until send occurs you can either declare the MailItem
WithEvents and handle item.Send() or declare the Outlook.Application object
WithEvents and handle application.ItemSend(). You still should save it
before you read Body or HTMLBody.
 
I'm having a similar issue.
How can I instantiate a MailItem if I only have the .msg file?
Thanks in advance.
 
The only way I know how to do that is to use the 3rd party Redemption
library (www.dimastr.com/redemption), which can import a MSG file as an
item, then you can save it and open it in the Outlook object model as an
Outlook object, or continue to deal with it as an RDO object.
 
Back
Top