win32all-132 / Word Automation

Nikolai Kirsebom nikolai.kirsebom at siemens.no
Tue Jun 20 04:15:19 EDT 2000


Mark,
Thanks for your quick response.  It might be obvious ... but not
really to me.

Here are the results from your suggested commands:

>>> print doc
Document2
>>> print doc.Variables
<win32com.gen_py.Microsoft Word 8.0 Object Library.Variables>
>>> print doc.Variables.Item
<method Variables.Item of Variables instance at 1f79250>
>>> print doc.Variables.Item(1)
Traceback (innermost last):
  File "<interactive input>", line 1, in ?
  File
"win32com\gen_py\00020905-0000-0000-C000-000000000046x1033x8x0.py",
line 11402, in __str__
    return str(apply( self.__call__, args))
  File
"win32com\gen_py\00020905-0000-0000-C000-000000000046x1033x8x0.py",
line 11398, in __call__
    return apply(self._ApplyTypes_, (0, 2, (8, 0), (), "Value", None)
)
  File "D:\Python\win32com\client\__init__.py", line 341, in
_ApplyTypes_
    return self._get_good_object_(apply(self._oleobj_.InvokeTypes,
(dispid, 0, wFlags, retType, argTypes) + args), user, resultCLSID)
AttributeError: 'tuple' object has no attribute 'InvokeTypes'


>
>This is different from VB, due to the different handling of byref args.
>
>Try:
>>>> print doc
>>>> print doc.Variables
>>>> print doc.Variables.Item
>>>> print doc.Variables.Item(1)
>
>And it should become obvious...
>
>Mark.
>
>
>




More information about the Python-list mailing list