Execute a Microsoft Word macro.
Syntax
CHGVAR VAR(&CMD)VALUE('WEXEMACRO')
CHGVAR VAR(&PARM1)VALUE('Macro Name')
CHGVAR VAR(&PARM2)VALUE('[Macro Parameters]')
CALL PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +
&PARM2 &RESULT)
Parameters
| 
   Parameters  | 
  
   
  | 
 
| 
   Parm1  | 
  
   Name of the macro. Sometimes the full name of the macro is needed. Example: Template.Module.Macro. 
  | 
 
| 
   Parm2  | 
  
   Parameters
  passed to the macro. 
  | 
 
Example 1
| 
   CHGVAR  | 
  
   VAR(&CMD) VALUE('WEXEMACRO')  | 
 
| 
   CHGVAR  | 
  
   VAR(&PARM1) VALUE('Macro1')  | 
 
| 
   CHGVAR  | 
  
   VAR(&PARM2) VALUE('"12000";"FRANCE" ')  | 
 
| 
   CALL  | 
  
   PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 + &PARM2 &RESULT)  | 
 
| 
   MONMSG  | 
  
   MSGID(LNC0000) EXEC(GOTO CMDLBL(ERROR))  | 
 
Exemple 2
Assuming we have the following macro with 2 parameters :
Sub
InsertTextAtEndOfDocument(param1 as string, param2 as string)        
ActiveDocument.Content.InsertAfter Text:= param1
ActiveDocument.Content.InsertAfter Text:= param2
End Sub
To run the macro, you can run the following command:
LNCCMD CMD(WEXEMACRO) +
PARM1('InsertTextAtEndOfDocument') +
PARM2('"Aura";"Equipements"')
See also
• WADDINS
• WGETPROP