in my model I have a Macro script
I want to execute this macro from within the load script, is that possible ?
For example you have a function:
function Test1() ' Type your VB script here . . . 'return a result Test1="Ok" end function
then the line
will execute the function.
You can also use functions with parameters:
function Test2(param1,param2) Test2=param1 & " " & param2 & "!" end function
The variable result2 now contains "Hello World!".
first of all thank you.
I have the macro script as in your example. it is ready and working if I trigger it from UI.
the macro script is in the macro script section (Ctrl+M) I want to trigger it from the script editor (Ctrl+E) .
i set the variable as you suggested but it isn't working
As @cwolf said, you can trigger Functions from the script, but not Subs. If your code is in a Sub, you will need to define a Function that calls the Sub.
When called from the script, VB Macro code cannot access the ActiveDocument object. So if you trying to do something like access chart data your macro will not work from script.