Passing an enumeration value using the Jacob bridge (COM / ActiveX)

Does anyone know if there is a way to pass the value of an enum using Jacob?

ComObj.ComEnum.enumVal1 ComObj.ComEnum.enumVal2 

I would like to pass enumVal1 or enumVal2 as Variant .

 o.invoke("Action",new Variant("enumVal1")); \\just pseudo code 
+4
source share
2 answers

Enumeration values ​​are available in the Object Explorer of the macro editor.

enter image description here

0
source

It seems that the OP is asking how to make the actual call ... from which getting the base values ​​(as @ChadiEM shown) is one part.

I found a post on a topic that says the values ... correspond to internally stored numbers and An enumeration in VBA is always of data type Long .

So, with this information and values, it is just a matter of passing a Variant with a value as long . For instance:

 o.invoke("Action",new Variant(34L)); 

I am sure there is a way to get the actual "Enumeration" data structures, but that was enough for me.

0
source

All Articles