Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / June 2003

Tip: Looking for answers? Try searching our database.

creating .MSG file from outlook_MailItem object

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
inon zukerman - 29 Jun 2003 07:28 GMT
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
Daniel Artuso - 29 Jun 2003 13:26 GMT
Hi,
Use the MailItem's SaveAs method with the olMSG constant in the Type
argument.

HTH
Dan Artuso, Access MVP

> Hi everyone ,
>
[quoted text clipped - 5 lines]
> Thanks alot
> Inon
Inon Zukerman - 29 Jun 2003 15:49 GMT
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
Daniel Artuso - 29 Jun 2003 23:10 GMT
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

> This is my code : and during the "oMailItem.SaveAs("c:/abc.msg","olMSG");"
> row I get a "type mismatch" error.
[quoted text clipped - 14 lines]
>
> Inon Zukerman
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.