[python-win32] Problem in accessing the Message body of Outlook Inbox.

venu madhav venutaurus539 at gmail.com
Fri Oct 10 07:35:59 CEST 2008


Here is the code:
rom win32com.client import Dispatch

session = Dispatch("MAPI.session")
session.Logon('outlook')  # MAPI profile name
inbox = session.Inbox
for i in range(inbox.Messages.Count):
    message = inbox.Messages.Item(i + 1)
    f.write(message.Subject+"\n\n")
    f.write(message.Body+"\n\n\n")

                  Hope you could get some idea based on this..

Thanks in Advance,,
Venu.


On Thu, Oct 9, 2008 at 10:07 PM, Tim Roberts <timr at probo.com> wrote:

> venu madhav wrote:
> > Hi all,
> >         How can I access the body of a mail in Outlook Inbox? I tried
> > various options like message.Body or message.Mesg etc. but didn't
> > work. I could get the subject of the mail using message.Subject
> > though.
>
> Show us the code you used.  There are several ways to get to Outlook,
> and the solution depends on what you used.
>
> --
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20081010/8537b25e/attachment.htm>


More information about the python-win32 mailing list