RE: python and outlook

Discussion in 'Python' started by Tim Golden, Oct 21, 2005.

  1. Tim Golden

    Tim Golden Guest

    [dt]

    > Are there any links or sites on how to read outlook mail boxes or

    address book?

    Easiest thing to probably to automate the Outlook COM object or a MAPI
    Session
    for CDO access. You can do this easily with the pywin32 extensions.

    http://pywin32.sf.net

    You can then use pretty much any published example from around the net.

    Example (to print the subject of each item in the inbox):

    <code>
    import win32com.client

    outlook = win32com.client.gencache.EnsureDispatch
    ("Outlook.Application")
    namespace = outlook.GetNamespace ("MAPI")
    inbox = namespace.GetDefaultFolder
    (win32com.client.constants.olFolderInbox)
    for i in range (inbox.Items.Count):
    message = inbox.Items[i+1]
    print message.Subject
    </code>

    TJG

    ________________________________________________________________________
    This e-mail has been scanned for all viruses by Star. The
    service is powered by MessageLabs. For more information on a proactive
    anti-virus service working around the clock, around the globe, visit:
    http://www.star.net.uk
    ________________________________________________________________________
    Tim Golden, Oct 21, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Hahn
    Replies:
    1
    Views:
    936
    Syver Enstad
    Sep 12, 2003
  2. dt

    python and outlook

    dt, Oct 21, 2005, in forum: Python
    Replies:
    1
    Views:
    328
  3. Guest
    Replies:
    2
    Views:
    474
    J Correia
    Apr 4, 2006
  4. cuordileone

    Outlook 2003 and Python

    cuordileone, Mar 25, 2008, in forum: Python
    Replies:
    2
    Views:
    329
    cuordileone
    Mar 25, 2008
Loading...

Share This Page