IBM Support

How to run post processing Macro on Word documents generated by Rational Publishing Engine 1.1 report

Question & Answer


Question

How do you run post processing Macros on a Microsoft Word document that is generated by running the IBM Rational Publishing Engine 1.1 report?

Answer

When generating documents in Microsoft Word format using IBM Rational Publishing Engine 1.1, it is possible to specify a macro to be executed at the end of the process.


Prerequisites for running Macro’s:
========================

  • Microsoft Word should be installed on the machine on which you want to run the post processing Macro.
  • The Macro you wish to run should be defined in the stylesheet used for Microsoft Word output.
  • In order to run macros for Microsoft Word 2007 formats the docm extension (Document with Macros) should be specified for the output document.


Note: The macro execution might take a while depending on how large the document is and how complex the macro is. Wait for the macro execution to complete before opening the Microsoft Word document.

There are two ways in which you can run Macro’s on the generated document:

OPTION #1 - Manually running the Macro on the generated document:
-----------------------------------------------------------------------------------
The Macro should be defined in the stylesheet used for the Microsoft Word output.
  1. Select the Macro
    1. On Microsoft Word 2003 click on Tools > Macro > Macros and locate the Macro that you wish to run
      or
    2. On Microsoft Word 2007, use the short cut key ALT + F8 to launch the Macro window and locate the Macro that you wish to run
  2. Click Run
These steps will run the Macro manually on the generated document and post processing tasks associated with the Macro on the document.



OPTION #2 - Automatically running the Macro once the Microsoft Word document gets generated:
---------------------------------------------------------------------------------------------------------------------------
  1. Launch IBM Rational Publishing Engine Document Studio 1.1
  2. Open the Document Specification file (*.dsx)
  3. Under the Output section, select ‘Target: Word’
  4. Under the “Properties” window, specify the complete path to the stylesheet that you will be using (which also contains the Macro in it)
  5. Once the stylesheet has been specified, specify the name of the Macro that you wish to run in the field “macro”
Example:
If the stylesheet named “TEST.dot” is stored in the “C:\” of the machine and has a macro “resolveLinks” defined in it. Then the “Target:Word” fields would have the following values:

Stylesheet: “C:\TEST.dot”

Macro: resolveLinks


When the above modifications to the document specification are saved and the document published using this document specification, the Microsoft Word document is generated and without any additional manual steps the macro that was specified in the document specification is also run/executed on the generated document.

[{"Product":{"code":"SSUBFB","label":"IBM Engineering Lifecycle Optimization - Publishing"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"1.1","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Publishing Engine

Document Information

Modified date:
16 June 2018

UID

swg21395685