Help with conversion VB script to Python : COM objects

mitsura at mitsura at
Mon Jun 26 14:48:17 CEST 2006


I need to re-write a VB script into Python (because I really don't like

The VB script is used to create a Windows COM object.
(I am more of Unix guy, so COM objects are a little bit alien for me).

At a certain point in the VB script, I have the following line:
objPolTypes = objPmad.Cvar(objPmad.GetPolicyTypeList)

Does anybody what the equivalent in Python would be?
I tried:
objPolTypes = objPmad.Cvar(objPmad.GetPolicyTypeList() )

but then I get the following error:
Traceback (most recent call last):
  File "C:\Python24\MyProgs\FodFin\", line 11, in ?
    objPolTypes = objPmad.cvar(objPmad.GetPolicyTypeList() )
  File "<COMObject PMAD.OvPmdPolicyManager>", line 2, in cvar
pywintypes.com_error: (-2147352571, 'Type mismatch.', None, 1)

I also tried :
objPolTypes = objPmad.GetPolicyTypeList()

this works but I end of with a list of COM object and have no clue how
to query/use them or what methods are defined for those type of

Any help really appreciated.

With kind regards,


More information about the Python-list mailing list