03-22-2011 05:19 AM
Would like to modify programmatically ActiveX/COM-step module settings (Automation Server, Object reference, Object class, method/property, parameters-list).
Can't find this in context. How this can be modified?
Thanks!
Solved! Go to Solution.
03-22-2011 11:39 PM
Hey bestware,
You need to get a reference to the step: RunState.Sequence.Main["MyActiveXStep"]
Then you can use that to convert to the ActiveX module: RunState.Sequence.Main["MyActiveXStep"].Module.AsActiveXModule
Once you have that you can do whatever you'd like with it. You can read in the help more about this. Search for ActiveXModule.
You sould see all sorts of properties: MemberType, MemberName, ServerID, ActiveXReferenceExpr. If you read about them they are refering to the different things you want to set. For instance the ActiveXReferenceExpr is where you store the Object Reference. The MemberType is Call Method (1), Get Property(2), Set Property(4) or Don't Call(-1), etc...
So to change the step to be a Get Property step I would do this:
RunState.Sequence.Main["MyActiveXStep"].Module.AsActiveXModule.MemberType = 2
To store an Object Reference to Locals.MyObj I would do this:
RunState.Sequence.Main["MyActiveXStep"].Module.AsActiveXModule.ActiveXReferenceExpr = "Locals.MyObj"
Hope this gets you pointed in the right direction.