Accessing Modification Time of an Outlook Mail in Python

Iain King iainking at gmail.com
Tue Nov 25 08:11:32 EST 2008


On Nov 25, 5:11 am, "venutaurus... at gmail.com"
<venutaurus... at gmail.com> wrote:
> Hi all,
>        I am writing a small application which reads the contents of an
> Outlook Mail using python. I am able to read the contents, subject
> along with senders and receivers of a mail using MAPI objects. But may
> I know how can I get access to the "modification time" or the
> receiving time of an outlook mail in Python. For the others I have
> used message object of MAPI session. Here I am pasting a sample code
> to get an idea of what am I doing.
>
> session = Dispatch("MAPI.session")
> session.Logon('outlook')  # MAPI profile name
> inbox = session.Inbox
>
> print "Inbox name is:", inbox.Name
> print "Number of messages:", inbox.Messages.Count
>
> for i in range(inbox.Messages.Count):
>     message = inbox.Messages.Item(i + 1)
>
> objSender = message.Sender.Address
> objRecip = message.Recipients.Item(j+1)
>
> Now here I want to access the modification time of each mail. And if
> possible if you can guide me to a place where I can get the elements
> of that message object, that would be helpful.
>
>  Please mail back for further information.
> Thanks in advance,
> Venu.

This looks like the API for the Message object:
http://msdn.microsoft.com/en-us/library/ms526130(EXCHG.10).aspx
Looks like you want TimeLastModified

Iain



More information about the Python-list mailing list