Programmatically Open a .msg file from the file system

  • Thread starter Thread starter Kenneth Myhra
  • Start date Start date
K

Kenneth Myhra

Hi all, I am trying to find a way to open a .msg from the file system using
the Microsoft Outlook object model. The way it is implemented now is by
using the Process.Start method, and then getting an object reference to the
newly opened MailItem in the Inspectors.NewInspector event.

I would like to have more control over it, and was therefore wondering if
there is any methods in the Outlook object model that I have overseen? That
could open an existing MailItem (.msg file) from the file system using the
Outlook object model. I am aware of such methods as CreateItem and
CreateItemFromTemplate, but they seem not do the trick I am looking for.

If any of you think that CreateItem or CreateItemFromTemplate is the right
way to do this then please enlighten me with your wisdom :-).

So my question is: Are there any methods or ways to open a .msg file from
the file system without using Process.Start / ShellExecute?

Best regards,
Kenneth Myhra
 
Since the .msg file is a file, you must use file system methods to run it.

If you want to import it back into Outlook (using Redemption -- see
http://www.outlookcode.com/codedetail.aspx?id=716), then you can use Outlook
methods on it.

CreateItemFromTemplate does not import. It makes a copy of the item as a new
unsaved, unsent item.
 
Thanks for your reply, actually I was hoping there was something similar to
Documents.Open in Word or WorkBooks.Open in Excel, but as I understood from
your answer this is not possible.

Thanks for directing me to the redemption library!

-Kenneth Myhra
 
Back
Top