Outlook COM: how to create a MailItem from a .msg file

Guy Lateur guy.lateur at b-b.be
Fri Jul 8 10:26:05 EDT 2005


python version:



import win32com.client

myOL = win32com.client.Dispatch("Outlook.Application")
myNS = myOL.GetNamespace("MAPI")
sItem = win32com.client.Dispatch("Redemption.SafeMailItem")

myDestBox = myNS.GetDefaultFolder(6)
oItem = myDestBox.Items.Add(0)

sItem.Item = oItem
sItem.Import("H:\\Inhoud-iedereen\\Inhoud-Guy\\app\\BBProject\\data\\test\\Leemarchitect.msg", 
3)
sItem.Save()






More information about the Python-list mailing list