creating .MSG file from outlook_MailItem object

  • Thread starter Thread starter inon zukerman
  • Start date Start date
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
 
Hi,
Use the MailItem's SaveAs method with the olMSG constant in the Type
argument.

HTH
Dan Artuso, Access MVP
 
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
 
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
 
Back
Top