Sunday, April 17, 2011

Python 3.0 Windows/COM

How to access a COM object from a python file using python 3.0.

And, yes, I know that not a lot of people are using Python 3.0. Switching back to 2.6 is a huge hassle for me, so I don't want to unless I absolutely have to.

I appreciate your time, and any assistance!

From stackoverflow
  • Install pywin32 and then create the object using it's progid:

    import win32com.client
    object = win32com.client.Dispatch("Outlook.Application")
    

    See also the Python and COM tutorial.

    EDIT: Hmm... looks like they may not have a python 3.0 version yet.

    Sean Ochoa : Dude, that was awesome. Lightning quick, too. :) I must have gone to either the wrong SF download page, or an old version of the same proj, or something. :) Thanks!

0 comments:

Post a Comment