How to access a property in Outlook using win32com?
Jonas Bengtsson
jonas.b at home.se
Thu Nov 21 07:29:09 EST 2002
Tim Peters <tim.one at comcast.net> wrote in
news:mailman.1037849249.16795.python-list at python.org:
> Heh. I doubt it, but we can *show* you: check out the Outlook2000
> directory in the spambayes project:
>
> http://tinyurl.com/2vt5
>
> and especially MAPIMsgStoreMsg._GetMessageText() in msgstore.py there.
>
> PR_TRANSPORT_MESSAGE_HEADERS is a MAPI property (not part of the
> *Outlook* object model), and it even took Mark Hammond several days to
> figure out how to access it without going thru CDO (Collaboration Data
> Objects -- yet another API-on-an-API-on-an-...).
Thanks!
But I have a hard time to realize how to use that code to extract that
data from a MailItem object. I guess I need some assistance. One
alternative is to rewrite the code from msgstore.py to just extract the
PR_TRANSPORT_MESSAGE_HEADERS provided a specific MailItem object. The
other alternative is to use parts of msgstore.py directly. What I want is
to get the headers and the body of all mails in a specific folder. How
should I use msgstore.py to be able to do that?
Any assistance appreciated!
> Be forewarned that the exact meaning of PR_TRANSPORT_MESSAGE_HEADERS
> isn't defined by MAPI, may contain lines that aren't valid SMTP
> headers, and can ne downright strange when looking at msgs handled by
> an Exchange server. For msgs delivered via POP3, they're what you
> expect. Mostly.
I can live with that :-)
Regards,
Jonas
More information about the Python-list
mailing list