Asked by:
Edit a saved Outlook Message File *.msg

Question
-
Hi All,
I'm trying to open a saved .MSG file and edit the contents (similar to how you would do it in Outlook 2010 if you click Actions->Edit Message) then send that email off to the intended recipients.
Can somebody please point me in the right direction, or maybe some source code that I can use? I've searched the internet and cannot get an answer for this.
My programming language is VB.NET
Thanks in advanced
- Changed type niveshp Saturday, December 24, 2011 5:57 AM Mistakenly selected the wrong type
Saturday, December 24, 2011 5:57 AM
All replies
-
Use Application.CreateItemFromTemplate to to create a new mesage and import the MSG file data.
Note that a standalone MSG file cannot be sent, it needs to be imported into a message created in one of Outlook's folders.
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.2 is now available!Saturday, December 24, 2011 9:48 PM -
I do not want to program in Outlook. I'm programming in VB.NET. Is there any tool that I can use to edit a MSG file? or can I edit an email before it is sent off?
Thanks
Monday, December 26, 2011 4:35 AM -
You can use Redemption and call RDOSession.GetMessageFromMsgFile - it returns an instance of the RDOMail object that you can use to modify any message properties and then call RDOMail.Save.
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.3 is now available!Friday, May 25, 2012 7:50 AM -
you can also use PInvoke to work directly with msg using
http://msdn.microsoft.com/en-us/library/windows/desktop/aa380342(v=vs.85).aspx
http://blogs.msdn.com/b/openspecification/archive/2009/11/06/msg-file-format-part-1.aspx
but i strongly discourage it. Redemption is much better choice.
Friday, May 25, 2012 8:15 AM