[python-win32] Sometimes, oleobj is returned instead of dispobj
Ivan Pozdeev
vano at mail.mipt.ru
Sat Jul 22 05:07:17 EDT 2017
See
https://stackoverflow.com/questions/45243545/when-getting-document-object-from-word-application-object-its-members-are-not-f
In brief, when getting properties of a "static" object, in some cases, a
"dynamic" object is returned even though there is info on its members:
|
In [112]: w =win32com.client.GetActiveObject('Word.Application')
In [113]: w
Out[113]: <win32com.gen_py.Microsoft Word 12.0 Object
Library._Application instance at 0x47365736>
In [114]: w.ActiveDocument
Out[114]: <win32com.gen_py.None.Document>
In [115]: d=_
In [116]: d._dispobj_
Out[116]: <win32com.gen_py.Microsoft Word 12.0 Object Library._Document
instance at 0x47366352>
Since this is very inconvenient and there's no earthy need to do so that
I can see, maybe a fix is in order?
|
--
Regards,
Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20170722/6e18683a/attachment.html>
More information about the python-win32
mailing list