open a .msg file

Joined
Feb 1, 2010
Messages
1
Reaction score
0
hi all,
i need to open a .msg file i saved in my local disk using c#.net. I searched through net for almost a week and have not found out what i need. i tried the createItemfromTemplate to do this and it worked, but what i need is the .msg file should open as such as we open by doubleclicking a mailitem from inbox or by rightclick->open from inbox.the way the file opens when using CreteItemFromTemplate is as a new mailItem with the fields of To:,CC:and all we can edit and make changes.It is not what i need.I want to open the file as we open from inbox where we cannot edit the fields but can see all the from,to:,CC:,Bcc:,and the messagebody.
One way i found was using System.Diagnostics.Process.Start(filename) where the result was as i needed.But instead i was asked to use the code with C# reflection.


For opening word documents the following code worked..But this is not possible with .msg files..


private string sFileName = string.Empty;
object oDocuments = null;
object[] oParams;

oDocuments = _Application.Documents;
oParams = new object[1];
oParams[0] = sFileName;
oDocuments.GetType().InvokeMember("Open",BindingFlags.InvokeMethod, null, oDocuments, oParams);


can u please help me with this???
 

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