Need Help with COM

Michael A. Howard mhoward at mahoward.com
Tue Aug 14 18:46:23 EDT 2001


I'm coming to Python from VB and trying to understand how the COM stuff
works.

I have a COM server (not written by me) that supports in VB the call
oAppPC.AppItem.Properties.Item(1).Caption
Which returns the caption of this item as I can see it from the object
browser in VB

The same call in python returns:
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
AttributeError: 'tuple' object has no attribute 'Caption'

If I use Excel as an example i.e.
o.Application.ActiveMenuBar.Menus.Item(1).Caption
I get   u'&File'
Which is also what I get in VB (well &File anyway)

So what am I doing wrong?






More information about the Python-list mailing list