Two properties with the same name


(David Naseby) #1

From: Maurício [mailto:briqueabraque@yahoo.com]

How can I access the value of the "type" property (in 

this example, it’s
supposed to be 25) instead of WIN32OLE?

WIN32OLE uses method_missing trick to dispatch to OLE properties. To
explicitly call a member, instead of relying on method_missing (which
obviously won’t be called if a method exists with that name), call
WIN32OLE::invoke(cmd, *args).

So in your case:

element.invoke(‘type’)

David Naseby

···

-----Original Message-----