Python and microsoft outlook-using com, can I interact with msoutlook?

G

Guest

Hi All,
I know that Microsoft Exchange has a com interface, CDO, but I can't seem to
find one for Microsoft outlook.
does anyone have code snippets for using msoutlook and python, or
suggestions?
I have looked on Google, and tried some code, but nothing has worked.
I'm using outlook XP, and any info y'all have is greatly appreciated.
Thanks,
Brandon mcginty


----------
Feel free to contact me for technical support, or just to chat; I always
have time to talk and help, and an open ear.
Email:[email protected]
Skype:brandon.mcginty
Msn:[email protected]
Aim:brandonmcginty (Not currently available.)
Cell:4802025790 (Weekends and nights only, please.)
"Kindness is a language that the deaf can hear and the blind can see."
Mark Twain
 
D

Daniel Dittmar

Hi All,
I know that Microsoft Exchange has a com interface, CDO, but I can't seem to
find one for Microsoft outlook.
does anyone have code snippets for using msoutlook and python, or
suggestions?

You can use CDO to manage your Inbox, send mail etc.

The following functions navigate to a certain folder and parse every
message text for a certain regular expression:

def spamstat ():
s = Dispatch ("Mapi.Session")
s.Logon ("Default Outlook Profile")
junk = findJunk (s)
rex = re.compile ('The ([0-9]+) emails listed below')
for msg in junk.Messages:
text = msg.Text
match = rex.search (text)
if match:
date = parseDate (msg.TimeSent)
print (date, int (match.group (1)))

def findJunk (s):
inbox = s.Inbox
for folder in s.Inbox.Folders:
if folder.Name == 'Junk':
return folder


See the Spambayes Outlook plugin (http://spambayes.sourceforge.net/) for
a complex example.

Daniel
 
J

J Correia

Hi All,
know that Microsoft Exchange has a com interface, CDO, but I can't seem to
find one for Microsoft outlook.
does anyone have code snippets for using msoutlook and python, or
suggestions?

Check out:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/173216
also:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/266625
and:
http://www.win32com.de/index.php?option=com_content&task=view&id=97&Itemid=192

Also I've emailed you a pdf I'd downloaded a while back,
unfortunately I can't remember the source to credit here.

That should get you started.

HTH,

JC
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top