[python-win32] win32Com.gencache.EnsureDispatch Problems

Vinay Anantharaman vinaya at adobe.com
Thu Aug 21 22:08:12 CEST 2008


Hi,

I executed the following code on a Windows Vista 64 bit machine with
Python 2.4.2 and the latest win32com:

 

            from win32com.client import gencache

try:

    outlook = gencache.EnsureDispatch("Outlook.Application")

except TypeError:

    print "uh-oh"

 

Result:

 

Traceback (most recent call last):

  File "<stdin>", line 4, in ?

  File "C:\Python24\Lib\site-packages\win32com\client\gencache.py", line
537, in EnsureDispatch

    GetModuleForCLSID(disp_clsid)

  File "C:\Python24\Lib\site-packages\win32com\client\gencache.py", line
240, in GetModuleForCLSID

    makepy.GenerateChildFromTypeLibSpec(sub_mod, info)

  File "C:\Python24\Lib\site-packages\win32com\client\makepy.py", line
325, in GenerateChildFromTypeLibSpec

    __import__("win32com.gen_py." + dir_name + "." + child)

  File
"C:\Users\vinaya\AppData\Local\Temp\gen_py\2.4\00062FFF-0000-0000-C000-0
00000000046x0x9x3\_Application.py", line 78

    ret = Dispatch(ret, u'CreateItemFromTemplate', None,
UnicodeToString=0)^M               return ret

 


SyntaxError: invalid syntax

 

I can makepy on the Outlook Com library manually however, I'd prefer to
use the EnsureDispatch function.

 

Thank you,

 

Vinay Anantharaman

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20080821/50cc80ff/attachment.htm>


More information about the python-win32 mailing list