Recording, saving, and storing macros

Macros automate application tasks. For example, WordPerfect macros automate tasks, such as setting margins, selecting a font, or creating a merge file. Macro tasks consist of instructions, called statements. There are several kinds of statements: assignments, conditions, loops, comments, and commands. For example,

  MarginLeft (1.0")   MarginRight (1.0")   

are WordPerfect commands that set one-inch left and right margins. Each command represents one instruction or statement. The simplest macro consists of only one statement. Complex macros have hundreds of statements. The sequence of statements determines how a macro performs its tasks.

One way to create a macro is to record a task in WordPerfect. When you record a macro, you convert actions into macro commands. These are stored until you need them. Use the fewest number of steps necessary to perform your task.

To include programming commands, or non-recordable actions, you must edit the macro after you record it. For more information about editing macros, see “Editing and deleting macros.”

You can instruct WordPerfect to pause while playing a macro if you want the macro to stop playing. This can be useful if you want to allow users time to type in text when they run the macro. When you play the macro, it runs until it reaches the PauseKey command.

WordPerfect allows you to store macros in any folder, including the default and supplemental macros folders. The default macros folder contains the macros with which WordPerfect was shipped. By default, WordPerfect’s shipping macros are stored in X:\Program files\Corel\WordPerfect Office\Languages\EN\macros\wpwin, where X represents the drive letter. You can use the supplemental macros folder as an additional folder to store macros.

You can specify how WordPerfect compiles and runs macros:

 
from the user’s temporary directory
 
from the user’s temporary directory, but only for read-only macros (default behavior)
 
directly from their source location


Storing macros in a centralized, shared repository

For scenarios in which multiple users require access to a set of macros, the best practice is to create a centralized, shared repository of macros. By directing users to this repository, the administrator can maintain the macros in a single location and ensure that all users are working from the same versions of those macros.

By default, WordPerfect automatically compiles macros that were created in a previous version of the software. The compile process locks the macro file, preventing other users from accessing it until the compile process is complete. For organizations that want to create a shared macro repository that supports multiple versions of WordPerfect, the best practice is to set WordPerfect to compile and run all macros locally (that is, from the user’s temporary folder).

WordPerfect Office tip Recording, saving, and storing macros

 
If your organization supports a version of WordPerfect earlier than WordPerfect X5, it’s a good idea to compile all shared macros by using the earlier version. In this way, you can prevent users from needing to recompile the shared macros.

To record a macro

WordPerfect Office btnbacktotopproc Recording, saving, and storing macros
1.
 
Click Tools WordPerfect Office onestep Recording, saving, and storing macros Macro WordPerfect Office onestep Recording, saving, and storing macros Record.
A check mark beside the Record command indicates that the command is enabled.
2.
 
Type a name for the macro in the Filename box.
3.
 
Click Record.
4.
 
Perform the actions you want to record.
A check mark beside the Pause command indicates that the command is enabled.

You can also
Pause recording a macro
Click Tools WordPerfect Office onestep Recording, saving, and storing macros Macro WordPerfect Office onestep Recording, saving, and storing macros Pause.
Resume recording a macro
Click Tools WordPerfect Office onestep Recording, saving, and storing macros Macro WordPerfect Office onestep Recording, saving, and storing macros Pause.
Stop recording a macro
Click Tools WordPerfect Office onestep Recording, saving, and storing macros Macro WordPerfect Office onestep Recording, saving, and storing macros Record.

WordPerfect Office note Recording, saving, and storing macros

 
A macro is saved with a .wcm filename extension.
 
If you are recording a new macro, clicking Edit WordPerfect Office onestep Recording, saving, and storing macros Undo will still retain the step that you tried to undo.

To change the default macros folder

WordPerfect Office btnbacktotopproc Recording, saving, and storing macros
1.
 
Click Tools WordPerfect Office onestep Recording, saving, and storing macros Settings.
2.
 
Click Files.
3.
 
Click the Merge/Macro tab.
4.
 
Click the Browse WordPerfect Office pgx browse Recording, saving, and storing macros button in the Default macro folder box.
If you want to change the supplemental macros folder, click the Browse WordPerfect Office pgx browse Recording, saving, and storing macros button in the Supplemental macro folder box.
5.
 
Choose the drive and folder where you want to store the macros.

To specify how WordPerfect runs and compiles macros

WordPerfect Office btnbacktotopproc Recording, saving, and storing macros
1.
 
Click Tools WordPerfect Office onestep Recording, saving, and storing macros Settings.
2.
 
Click Files.
3.
 
Click the Merge/Macro tab.
4.
 
From the Compile and run locally list box, choose one of the following:
All macros — compiles and runs all macros from the user’s temporary folder
Read-only macros — compiles and runs macros from the user’s temporary folder if they are marked as read-only. This is the default setting.
No macros — compiles and runs all macros directly from their source location

Recording, saving, and storing macros