Running the macro by using the post-command property

About this task

System variable names, output names, and template variables can be used in your command.

Procedure

  1. Record or specify the macro in the Microsoft Word or Microsoft Excel document that is being used as a style sheet.
  2. In the Launcher application, select the template that is listed in the document specification view.
  3. If you are using a style sheet that contains macros, for the style sheet property, enter the path to the document-style report or style sheet that contains the macro.
  4. For the post-command property, enter an argument using the cscript command. The cscript command is used to start the Windows Script interpreter to run the macro.
    Example:
    • cmd /c cscript "PUB_install_dir\utils\word\runmacro.vbs" "${Word}" macro_name "${varA}"
    • cmd /c cscript "PUB_install_dir\utils\excel\runmacro.vbs" "${Excel}" macro_name "${varA}"
    Note: If your argument contains white spaces, you must enclose the argument in quotation marks (" ").
  5. Generate the output.
    varA is replaced with the value of the variable that is specified in the template.

Results

The macro is run by Microsoft Word or Microsoft Excel to update the data after the output is generated. varA is replaced with the value of the variable that is specified in the template.