Looking for a way to save a .msg file or load a .msg file?
Outlook Object Model (OOM) can do this easily. Below is a sample:
howto - save and load a message to a folder.
Sub SaveAndLoadMsgFile()
Dim ol As Outlook.Application
Dim olns As Outlook.NameSpace
Dim oOrigItem As Outlook.MailItem
Dim oNewItem As Outlook.MailItem
Set ol = CreateObject("Outlook.Application")
Set olns = ol.Session
Set oOrigItem = olns.GetDefaultFolder(olFolderInbox).Items(1)
oOrigItem.SaveAs "C:\test.msg", olMSG
Set oOrigItem = Nothing
Set oNewItem = ol.CreateItemFromTemplate("c:\test.msg")
oNewItem.Display
End Sub
Comments
Anonymous
December 15, 2013
Did you used webdav before to save message with .msg ext before. As above sample not works with web servers throw iisAnonymous
December 15, 2013
Did you used webdav before to save message with .msg ext before. As above sample not works with web servers throw iis