PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
creating .MSG file from outlook_MailItem object
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
creating .MSG file from outlook_MailItem object
![]() |
creating .MSG file from outlook_MailItem object |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 > > > > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#4 |
|
Guest
Posts: n/a
|
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 > > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

