Hi

I am trying to write an activestate win32 python program that will
(hopefully) open up Outlook .MSG files that have been archived offline,
print out any file names for any attachments therein and then also go on to
save off those attachments as separate files.

This is a project to do with processing an offline archive of .MSG files. I
am not looking to intercept incoming emails at some other point in an
Exchange or Outlook program - but to read stored off .MSG files.
Outlook/Exchange will be on this system so I will have access to the
necessary Microsoft DLL's for MAPI services.

As I understand it MSG files are structured storage files.
So far I have got to the stage where I can read in an MSG file via the
StgOpenStorage and the OpenIMsgOnIstg methods and from there get to the
attachments table using the GetAttachmentTable method. I can see how many
attachments there are via the call to GetRowCount for this object.

But I cannot work out how to use the SetColumns method to specify as I would
under Visual C++ the properties PR_ATTACH_NUM, PR_ATTACH_SIZE,
PR_ATTACH_FILENAME so that I can retrieve the name of the attached file from
the attachment table.

And from that point to progress and save the attachment as a file.

Under Visual C++ I would use the values PR_ATTACH_NUM, PR_ATTACH_SIZE,
PR_ATTACH_FILENAME to do a call to SetColumns and then walk the results from
a QueryRows method on the attachment table.

The python online documentation tells me to use an SPropTagArray sequence
object as the argument for SetColumns but I am unsure about how to identify
these properties to create that sequence. In other words how to tell it the
sequence PR_ATTACH_NUM, PR_ATTACH_SIZE, PR_ATTACH_FILENAME

Any help would be most appreciated - else I need to go off and write a
Visual C++ program instead to do this.


Kind Regards

Mark

_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython

Reply via email to