[python-win32] Outlook COM: how to create a MailItem from a .msg file

Guy Lateur guy.lateur at b-b.be
Mon Jul 4 16:36:08 CEST 2005


Hi again,
 
I've also tried using my_MItem = win32com.client.CastTo(my_DItem,
'MailItem'), but it doesn't work. It says "The interface name 'MailItem'
does not appear in the same library as object
'<win32com.gen_py.Microsoft Outlook 11.0 Object Library._DocumentItem
instance at 0x29912600>".
 
Any help would be greatly appreciated.
 
g
 
 
 

________________________________

From: Guy Lateur 
Sent: donderdag 30 juni 2005 10:53
To: 'python-win32 at python.org'
Subject: Outlook COM: how to create a MailItem from a .msg file


Hi all,
 
I've been writing some code to move some data into and out of Outlook
(2003 + Exchange 2003). I have some email .msg files on our file server,
and I can't seem to get them back into the Outlook object I need, ie a
MailItem. I've tried to use App.CopyFile() to (temporarily) put the file
in an OL folder. Problem is, however, this returns a DocumentItem and
not a MailItem.
 
Is there any way I could 'cast' this DItem into a MItem? Apparently, OL
treats it as any general document - which, btw, shows in the view, too;
it has another icon and you have to open it to view it). Or maybe
there's another way to open it; I really only need the object in memory.
Any ideas?
 
TIA,
g
 
 
 
PS: This may get double-posted due to some subscription issues I was
having earlier. Sorry for the inconvenience.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20050704/a5ffce64/attachment.htm


More information about the Python-win32 mailing list