Articles  
 
[Printer-friendly version]
Macros: The "Robots" of WordPerfect®
By Gordon McComb

Wouldn’t it be nice to have a robot do the cooking, the washing and all the other chores that make life such a drag? It’s a nice dream but, sadly, the days of having a machine do our menial tasks may still be few decades away.

Yet it’s nice to know you can use the equivalent of a hard-working robot to save yourself time and energy when using WordPerfect®.

The robots of WordPerfect—they’re called macros—don’t look much like C-3PO or R2-D2 of Star Wars® fame, but they can be just as handy. With a macro you can automate repetitive steps for preparing letters, memos or other documents. Macros can also “think” and make decisions, and can be made to appear like add-ons to the already powerful set of features in WordPerfect.

There is a lot to learn about what WordPerfect macros are and how to use them. I’ll touch on the basics in this installment, including how to best use macros and how you can create your own with no more effort than recording a new announcement on your voice-mail.

Macros Are Really Just Shortcuts
The word “macros” sounds a little ominous, yet the concept is far from scary. Briefly, macros are shortcuts to building documents. Most tasks you perform with WordPerfect® are repetitions of things you do over and over again. You can become a more efficient WordPerfect user by making a shortcut of these tasks.

Another way to look at a macro is as a recording of keystrokes and commands. You activate the recording at the touch of a key—like the auto-dial feature on your phone or fax. Instead of pressing the digits yourself to call your mother in Minneapolis, you store her phone number in the phone’s memory. When you feel the urge to talk, you just press the button for “Mom.”

WordPerfect comes with a number of sophisticated macros you can use right away; these are good examples of the power possible with macros. To see a listing of the macros included with WordPerfect 8 or 9, chose Help, Help Topics (or press F1). When the Windows® Help window appears, click the Index tab. Type “shipping macros” and press Enter. Shown is a list of the shipping macros and what they do.

The macros that come with WordPerfect are fairly sophisticated applications in and of themselves. They show what you can do with the power of programmed macros. Don’t let their complexity fool you: even simple macros can be useful. Fortunately, it’s easy to create your own simple macros: you just record them, duplicating the keystrokes and commands you want repeated. Then, whenever you want WordPerfect to follow your previously recorded shortcut, you just play the macro.

Knowing When to Use Macros
No job is too small for a macro. The way you use macros will depend on how you use WordPerfect. The more you do the same kinds of jobs over and over again, the more you’ll want to turn those tasks into macros. Though the main application of macros is to make your job easier by reducing the number of steps it takes to get a job done, there are other worthwhile benefits of macros, such as:
  • to simplify a complex task for a WordPerfect novice as not everyone is a whiz at WordPerfect. Some users need help in applying more sophisticated features in WordPerfect, and macros are just the ticket to make sure they use the features properly
  • to improve accuracy and consistency. Macros help you repeat the same steps over and over again, in exactly the same way. Such consistency makes your work with WordPerfect look more professional. For example, your macro might help you create monthly reports by performing some of the text entry and formatting automatically. The macro helps ensure all the reports, month after month, follow the same consistent design
  • to endow WordPerfect with a feature it didn’t have before. Macros are like miniature programs that you run inside of WordPerfect: the more sophisticated macros can actually add features to WordPerfect that it didn’t have before

Recording Your First Macro
Now that you know a little bit more about macros and when you should use them, it’s time to turn theory into reality by recording a macro. Relax, it’s easy!

For a sample macro, let’s record one that toggles the case of the current character—that is, if the current character is lower case, the macro makes it upper case, and vice versa. This requires that there be text already in the document. So, begin by opening a new, blank WordPerfect® document by choosing File, New. Type wordperfect, with the capitalization as shown. For example purposes, position the insertion point immediately before the w. To begin recording the macro, do the following:
  1. Choose Tools, Macros, Record. The Record Macro dialog box appears.
  2. In the Filename box, type tog, for “toggle” (you can type the name in upper or lower case), and choose Record.
  3. Hold down the SHIFT key and press the right arrow key. This selects the current character, which is w.
  4. Press CTRL + K. This toggles the case of the character—w becomes W.
  5. Press F8; this turns selection off. These are all the steps necessary for the macro.
  6. Turn macro recording off by choosing Tools, Macros, Record. The Macro Record indicator disappears, and macro recording stops.

You’ve just created your first macro!

Note: The idea behind macros is that they save you time; so, rather than choose the Tools, Macros, Record command to turn macro recording on and off, merely press CTRL + F10 instead.

Playing Your Macro
Once a macro is recorded, you can play it back any number of times. For example, let’s play back the TOG (character toggle) macro recorded previously. Before playing the macro, prepare WordPerfect by placing the insertion point immediately before the p in Wordperfect in your previous document.
  1. Choose Tools, Macro, Play. The Play Macro dialog box appears. The Play Macro dialog box looks just like the Record Macro dialog box, except it has a button marked Play instead of Record.
  2. Pick the macro you want (in this case, the TOG macro) and Choose Play. WordPerfect plays the TOG macro, and the p becomes a P.


  3. Note: As with recording a macro, WordPerfect offers a keyboard shortcut to play a macro: pressing ALT + F10 is the same as choosing Tools, Macro, Play.

Good Names For Your Macros
The TOG macro will be stored in a separate file on your computer’s hard drive. Unless you specify otherwise, WordPerfect® automatically appends a .WCM extension to the end of the file. The actual file, as stored on your computer, is called TOG.WCM.

When recording macros, try to give them meaningful but short names—short so that you don’t have to type a lot to play them. Here’s an example: for a macro that sets the margin to two inches, you might name it MARG2. The idea is to make the name long enough so that you’ll understand its purpose weeks or months after you’ve recorded it.

If you plan on using a macro quite frequently, you can give it a “shortcut” name, using the CTRL or CTRL + SHIFT keys. You play them back by pressing the CTRL key and a letter key (or CTRL, SHIFT and a letter key); I call these “quick access” macros. As you can see in the following table, a number of key combinations are already taken by the built-in WordPerfect shortcuts. However, several openings are available for use in giving shortcut names to your quick access macros.


Key  
Pressing
CTRL + Key
Pressing
CTRL + SHIFT + Key
A


B
C
D
E

F
G
H

I
J

K


L

M
N

O

P
Q

R

S

T


U
V
W
X
Y
Z
Select all


Bold
Copy text
Date text
Center
justification
Font
Go to
Outline body
text
Italic
Full
justification
You might
name it
Case toggle
Left
justification
<None>
New
document
Open
document
Print
Find
QuickMark
Right
justification
Save
document
New
document
window
Underline
Paste
Insert symbol
Cut
<None>
Undo
QuickWords Insert (WordPerfect 9;
unassigned in 8)
Insert bullet
Drop Cap
Date code
<None>

Find next
<None>
Print history dialog box
<None>
<None>

<None>


Line break

<None>
New from project

Outline define

Print document
Set QuickMark

Redo (WordPerfect 8; unassigned in 9)
Save all

<None>


<None>
Paste simple
<None>
<None>
<None>
Redo (WordPerfect 9; Undelete in 8)


CTRL + Y is not otherwise taken by a built-in WordPerfect shortcut, so that you can use it readily to name a quick-access macro. (You can also use CTRL + M, but WordPerfect already comes with a ctrlm.wcm macro—it displays the Macro Command Inserter, which you’ll want to use when you start writing and editing macros.)

To give a macro a CTRL + key name, name the macro Ctrlx.wcm, where x is a letter or number. Conversely, to give a macro a CTRL + SHIFT + key name, name the macro Ctrlsftx.wcm. For example: Ctrlsftm.wcm is played by pressing the CTRL + SHIFT + M keys at the same time.

Now that you’ve learned the basics of these “macro robots,” you’re ready to put them to work for you. Macros don’t need batteries, they always do the job right the first time and they never complain about the boring jobs they’re given. This robot idea sounds pretty good!
Gordon McComb is a writer and consultant specializing in macros for word processors. His latest books on WordPerfect macros can be found at http://www.gmccomb.com/. He can be reached at gmccomb@gmccomb.com.

Disclaimer: The information provided on OfficeCommunity.com is not legal advice, but is intended to be general information related to business issues. Articles reflect the opinion of the author and do not imply sponsorship, endorsement or approval by Corel Corporation.



   
  WordPerfect®
  Corel™ Presentations®
  Quattro® Pro
  CorelCENTRAL™
  Paradox®
 
 



Copyright © 2003 Corel Corporation. All rights reserved.
Company and product names are trademarks or registered trademarks of their respective companies.