Specify a Word Template for Storing Post-Assembly Macros

You can insert PLAY instructions in templates to play macros after assembly is complete. Such macros are used to update references in the document, remove unused markup coding, apply custom formatting to answers, and so forth.

With a DOTM or DOT template, the macro to be PLAYed can simply be included in the HotDocs template itself. After assembly, HotDocs temporarily attaches the original template to the assembled document so that when the PLAY instruction is processed, Word automatically finds the macro to be PLAYed.

With a DOCX or RTF template, however, you can't store macros in the template. While you can place macros to be PLAYed in a global template saved in Word's Startup folder, or add the macros to Normal.dot, this can be inconvenient, since you must either provide instructions for the user on how to save the global template to the Startup folder or you must instruct them on how to modify Normal.dot.

To accommodate this, you can store your post-assembly macros in a Word template, which you can then associate with the HotDocs template. You specify the name of this Word template file at the Component File Properties dialog box for the template. This Word template must be stored in the same folder as the HotDocs template that uses it.

To use a post-assembly macro template

  1. Create a Word DOTM or DOT template and store your macro in it. (See the Microsoft Word documentation for instructions on doing this.)
  2. Edit the template to which you want to attach the macro. (See Edit a Template.)
  3. Insert the PLAY MACRO instruction in the template. (See PLAY "MACRO".)
  4. Open the Component File Properties dialog box for the template. (See Change Component File Properties.)
  5. Click the Assembly tab, and, in the Post-assembly macro file field, enter the name of the template you created in Step 1. (Remember, the Word macro template must be stored in the same folder as the HotDocs template.)

Post-assembly macros are played whenever the user creates a document from the template, specifically when the user prints the document, saves the document to disk, or sends the document to the word processor.