[python-win32] get embedded images from outlook (original) (raw)

Tim Roberts timr at probo.com
Tue Jan 8 00:01:11 CET 2008


Antony Joseph wrote:

This code can read the content of mails body , html and headers from outlook. in case , it there's an embedded image, Its not getting the image, ... propids = (PRBODYA,MYPRBODYHTMLA,PRTRANSPORTMESSAGEHEADERSA) hr,data=obj.GetProps(propids,0) body = GetPotentiallyLargeStringProp(obj,propids[0],data[0]) html = GetPotentiallyLargeStringProp(obj,propids[1],data[1]) headers =GetPotentiallyLargeStringProp(obj,propids[2],data[2]) can anybody tell me , how can i get the images?

PR_HASATTACH tells you whether the message has an attachment. Then, you'll have to fetch the attachment table for the message, and fetch the data from that. You may need to do some reading about this. You can fetch the PR_MESSAGE_ATTACHMENTS property to get the table, it is of type IMAPITable, not IStream. You then have to enumerate those, and fetch the PR_ATTACH_DATA_BIN property for the attachment you want.

-- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list