views:

1345

answers:

2

I've been inspired by Modifying Microsoft Outlook contacts from Python -- I'm looking to try scripting some of my more annoying Outlook uses with the win32com package. I'm a Linux user trapped in a Windows users' cubicle, so I don't know much about COM.

I'm looking for information on whether COM allows for reflection via win32com or whether there's documentation on the Outlook 2007 COM objects. Any other pointers that you think will be helpful are welcome!

I've found Programming Outlook With Python, but I'm using Outlook 2007 so I'd like some more information on how much of the Outlook 2000 information is still applicable.

TIA!

+4  A: 

To answer your question about documentation. Here are two links that I regularly visit when developing Outlook macros. While the sites are primarily focused on development with MS technologies most of the code can be pretty easily translated to python once you understand how to use COM.

Zoredache
+4  A: 

In general, older references to the object model are probably still valid given the attention Microsoft pays to backwards-compatability.

As for whether or not you will be able to use win32com in python for Outlook, yes, you should be able to use that to make late-bound calls to the Outlook object model. Here is a page that describes how to do it with Excel:

http://oreilly.com/catalog/pythonwin32/chapter/ch12.html

A problem that you should be made aware of is the fact that Outlook has a security dialog that is thrown up when external programs try to access the object model and perform operations in outlook. You are not going to be able to suppress this dialog.

If you want to avoid the dialog, you are better off creating macros in VBA for Outlook that are loaded in a session, and put buttons on a new CommandBar to execute them.

casperOne
Yikes -- that's a sad prospect. No way to whitelist a given program?
cdleary
One way to avoid Outlook Security issues is to use redemption. (http://www.dimastr.com/redemption/) Also see this page for other methods (http://www.outlookcode.com/article.aspx?ID=52) to get around Outlook security.
Zoredache