WordPerfect Macro Tutorial:
Working with Template Macros

Learn how to create reusable template macros

In the previous tutorial you learned how WordPerfect works with macros stored as files.

WordPerfect can also store macros in templates. All the macros are combined in the template, and are accessible as long as you are using the template.

Whether the macro is stored in a separate file or in a template it is recorded and played back in the same manner. And, regardless of the location of the macro, the macro functions in the same way.

While file macros have their distinct advantages (if something happens to the macro, only one file is affected, rather than the entire template), template macros come in handy in many instances.

  • Macros stored in a template are contextually tied to the template. They are only accessible when you use the template; at other times, they are out of the way and therefore less likely to cause confusion to novice users.
  • If the template contains many macros, you can distribute those macros to others simply by copying the one template. Templates can store other items too, such as abbreviations, styles, menus, and Toolbars, so if your macros access these items, they can all be stored in one neat package.

Recording a Template Macro

The technique for recording a template macro is nearly identical to recording a file macro.

  • Choose Tools, Template Macro, Record.
  • Type the name of the macro, and choose Record.
  • Follow the procedure outlined above for recording a file macro. When done, press Ctrl+F10 to stop recording.

Playing a Template Macro

To play a macro stored in a template:

  • Choose Tools, Template Macro, Play.
  • Select the macro, or type the name of the macro to play.
  • Choose Play.

Changing the Template Macro Location

When playing template macros WordPerfect will only display (and find) the macros located in the "storage depot" you have indicated as the current source for macros. This may be the default template, but it may also be some other template that you used to make the document - this is the case, for example, if the currently open document was made using the File, New From Project command.

If the macro you want is in the current template, but WordPerfect is set to look for a macro in another template, it will not find the one you want to play.

Before playing a macro, take a quick look at the Play Macro dialog box to be sure it indicates the proper macro source. It'll say "Macros in template <blah blah>," where <blah blah> is a specific template name. If you want to play a macro located elsewhere, choose Location, then choose the source accordingly.

WordPerfect remembers the source selection as long as you remain in the program. The selection isn't made permanent unless you check the Use as Default option in the Macro Location dialog box.

Editing Template Macros

Earlier in the tutorial you read how macros could be edited (opened) using either of two techniques: with the File, Open command, or the Tools, Macro, Edit command.

Template macros can only be opened (for editing and printing) using the Tools, Macro, Edit command.

  • Choose Tools, Template Macro, Edit.  Select the macro to edit, then choose Edit.
  • Edit the macro (or print it or whatever). When done, choose Save & Compile in the Macro Feature Bar.
  • Close the macro when done by choosing File, Close.