PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming creating .MSG file from outlook_MailItem object

Reply

creating .MSG file from outlook_MailItem object

 
Thread Tools Rate Thread
Old 29-06-2003, 07:28 AM   #1
inon zukerman
Guest
 
Posts: n/a
Default creating .MSG file from outlook_MailItem object



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




  Reply With Quote
Old 29-06-2003, 01:26 PM   #2
Daniel Artuso
Guest
 
Posts: n/a
Default Re: creating .MSG file from outlook_MailItem object

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

HTH
Dan Artuso, Access MVP

"inon zukerman" <inonzuk@hotmail.com> wrote in message
news:eq5MCdgPDHA.3700@tk2msftngp13.phx.gbl...
>
> 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
>
>
>
>



  Reply With Quote
Old 29-06-2003, 03:49 PM   #3
Inon Zukerman
Guest
 
Posts: n/a
Default Re: creating .MSG file from outlook_MailItem object

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




  Reply With Quote
Old 29-06-2003, 11:10 PM   #4
Daniel Artuso
Guest
 
Posts: n/a
Default Re: creating .MSG file from outlook_MailItem object

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

"Inon Zukerman" <inonzuk@hotmail.com> wrote in message
news:uvD1b2kPDHA.1624@tk2msftngp13.phx.gbl...
> 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
>
>
>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off