Accessing Word object model from Python COM server

Mark Hammond MHammond at skippinet.com.au
Fri Nov 5 23:29:27 CET 1999


Nikolai Kirsebom wrote in message <3822a7d2.251040356 at news.mch.sni.de>...
>
>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.

Mark.







More information about the Python-list mailing list