creating .MSG file from outlook_MailItem object

I

inon zukerman

Hi everyone ,


how do I create a .MSG file from a Outlook._MailItem object ??
can anyone give me any lead ?

(in C# of course )

Thanks alot
Inon
 
D

Daniel Artuso

Hi,
Use the MailItem's SaveAs method with the olMSG constant in the Type
argument.

HTH
Dan Artuso, Access MVP
 
I

Inon Zukerman

This is my code : and during the "oMailItem.SaveAs("c:/abc.msg","olMSG");"
row I get a "type mismatch" error.
any insight ?
oApp = new Outlook.Application();

oNameSpace= oApp.GetNamespace("MAPI");

i = oApp.ActiveExplorer().Selection.Count;

oMailItem = (Outlook.MailItem)oApp.ActiveExplorer().Selection.Item(1);

oMailCopy = (Outlook.MailItem)oMailItem.Copy();

oMailItem.SaveAs("c:/abc.msg","olMSG");



thanks In advance

Inon Zukerman
 
D

Daniel Artuso

Hi,
I thought I sent a reply but I guess it didn't make it.
olMSG is NOT a string. Don't enclose it in quotes.

HTH
Dan Artuso, Access MVP
 

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