win32all-132 / Word Automation

Mark Hammond MarkH at ActiveState.com
Mon Jun 19 20:06:41 EDT 2000


I guess your problem is here:

> >>> print doc.Variables.Item(1).Name
> -------------------------

> AttributeError: 'tuple' object has no attribute 'InvokeTypes'

With the implication being that "doc.Variables" is returning a tuple, not
a COM object as you expect.  It is likely the COM object you expect is
_in_ the tuple.  Either that, or the "Item(1)" call is returning the
tuple.

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