Accessing Word object model from Python COM server

Mark Hammond MHammond at
Fri Nov 5 17:29:27 EST 1999

Nikolai Kirsebom wrote in message <3822a7d2.251040356 at>...
>When the GetNew method in the Python COM server is executed, an error
>indicates that the name 'Documents' is invalid.  The self.ApplObj is
>of type PyIDispatch (I think), however may it must be an 'instance' in
>order to be able to access the object model.  If I instead of

This is correct.  What you need to do is

doc = win32com.client.Dispatch(doc)

This will wrap it in the Python class that manages all the magic.


More information about the Python-list mailing list