macros here on the Toolbox for WordPerfect site that can be downloaded (in
.ZIP files) to your system are already compiled and functioning (see Downloading and
Installing Macros and Templates).
The downloadable macros on the Toolbox site (found mostly in the Library) are not
the "raw" or "plain text" macro code such as you might see
posted on another web site (and even on some other Toolbox pages).
On the other hand, plain-text macro
code -- the subject of the next column -- is simply a series of
macro commands that were typed or copied into that web
site as ordinary text characters. Those commands
are not yet macros!
The simple, step-by-step procedure in the next column
turns such plain-text macro code into a functioning macro.
you use the first release of WordPerfect 11 (i.e., 126.96.36.199, as shown in your WordPerfect's Help >
About WordPerfect menu), then you should read this page (in the
WordPerfect 11 section) about a bug in that release that can
impact macros from any source, even those from Corel that are
shipped as part of the program.
How to copy plain-text macro code from the
Internet (i.e., web page, newsgroup post, or e-mail) into WordPerfect
to create a functioning macro.
[Note: For macros available here in the Toolbox Library, see the sidebar at left. Those macros are "ready to go" once you copy them into the appropriate folder on your computer.]
Once you have done
this once or twice, you will find it a simple and easy way of using
macros that others have written.
To begin, note the frequent use of the word "copy" on this
should not have to manually type any text to create the functioning
macro. (You can do so
later to edit it, but for now you can simply use standard Windows copy
and paste methods, as explained below.)
As we all know,
typing can be prone to error, and macro commands are very
exact. A macro follows a set of instructions (the "macro code"),
but since it is a dumb robot even a single misplaced
character or punctuation mark can prevent it from working properly.
Hence, the process
below is basically a simple
procedure from the source material into WordPerfect, which should help
Briefly examine the plain-text macro code
to determine where it begins and ends.
Often, macro writers will use programmer's
comments (in WordPerfect, they typically begin with two slash
marks, "//" [see here for other types])
to tell you where the macro begins and ends.
If not, often the first command is an Application() command. As often,
the last command is usually Return or Quit. (Don't worry if you don't
see an Application, Return, or Quit command. They are not always
Also, you can ignore any lines at the beginning and end that contain only
horizontal lines, spaces, hyphens, or similar "separators.")
Note: On WordPerfect Universe, the posted
code is usually (but not always) inserted inside a scrollable Code:
window, located inside the post. The code in that window can be
selected (next step) and copied the same as code in any other part of
text from beginning to end, and copy the selection to the Windows
clipboard with Ctrl+C (or Edit, Copy).
On WordPerfect Universe,
select the macro code directly from the WordPerfect
Universe Forum screen, not from inside a "Reply" screen. This
will eliminate any WordPerfect Universe formatting "tags" that might
have been added by the
original poster. [You can, of course, use the Reply screen -- but
you should copy only the
comments and commands between
any beginning ([code]) and ending ([/code]) tags, since those
bracketing tags are not part of the macro's code.]
For long macros posted on WordPerfect
Universe inside the scrollable Code:
window, the code can extend below the bottom of the window. Simply
click directly on the top left of the code (even though you won't see
any cursor appear there), then hold down the Shift key while you tap
the arrow keys to "paint" the macro's code. (Don't just hold down an
arrow key or you might overshoot the end of the code and paint other
things on the screen.) Then use Ctrl+c to copy the selection to the
Open a new, blank document in WordPerfect and click on Tools, Macro, Macro Toolbar to
display the Macro Toolbar.
Open Reveal Codes if it is not already open (View, Reveal Codes). This helps
with the next step.
Position your cursor immediately after any codes in the new document --
typically, this is immediately after the
[Open Style][Ln Num: On] codes. Look in Reveal Codes to
see where the cursor is located, and use the arrow keys to reposition
it if necessary.
Then click on Edit, Paste Special,
Unformatted Text to paste the macro code into the WP document
without any extraneous formatting or other unwanted codes.
☼ Important: Some parts of some commands might not be completely copied into WordPerfect -- but there's an easy solution.
For example, WordPerfect symbols
that are inserted in some macro commands (with Ctrl+w) in the original
code might be changed to something else, such as a simple "?" or some
other "odd" text character.
More frequently, some macros are designed by their
authors to use Search and (sometimes) Replace commands to find various WordPerfect format codes in the
document and process them in some way. These items can also be changed to something other than the correct WordPerfect codes.
☼ The reason:
Format codes are "binary codes" and, unlike the
rest of the macro commands (which are ordinary text characters), they cannot
be copied into a web page, newsgroup post, or email.
These codes get stripped
out by the web page, post, or email because web sites and email programs -- as well as most other Windows
programs -- do not recognize WordPerfect format codes.
Most authors typically work around
this limitation by using plain text characters as a "placeholder"
to represent the binary code when they post their code on a web page or
newsgroup. The most common place you will see this in a macro is in a SearchString and/or ReplaceString command's parameter (the part of the
command enclosed in parentheses).
☼ The solution:
After you paste the copied macro
code into WordPerfect, be sure to replace any WordPerfect symbol placeholders. (See Insert, Symbol for the entire Symbol Set.)
Similarly, any format code
placeholders in the SearchString() and ReplaceString() commands (or
where otherwise indicated by the author) should be replaced with the actual WordPerfect
binary codes from the Codes button on the Macro Toolbar.
For example, when you paste the code into WordPerfect and you see a command like
this (i.e., plain text characters without any actual format codes, which can be seen in Reveal Codes) --
-- just delete the text string, [HRt],
inside the parentheses (but keep the two ordinary double quote
marks, if any). Then, in its place, insert the actual binary code
with the Codes button on the Macro Toolbar.
The Codes button brings up a
long list of codes. In the example above, after you delete the text
placeholder you would place your cursor between the two (now adjacent)
double quote marks and click the Codes button on the Toolbar to bring
up the Macro Codes dialog containing a list of codes. Under the Search
tab in that dialog, choose HRt from the list, then click the Insert
button, then click Close. In Reveal Codes you should now see a
code [Macro Func], which is the binary code, between the double
quote marks. In the main document window, it will display
itself as the particular type of code required by the macro (e.g.,
Save the pasted material with the Save & Compile button on the Macro Toolbar.
Give the macro a name that will help you remember it.
☼ This step saves the macro to your default
macros folder as shown in Tools, Settings, Files, Merge/Macro.
(Advanced users may wish to save to a different folder, and will
therefore need to include the path to that folder.)
☼ The resulting file will have a .wcm
filename extension, which WordPerfect will recognize as a macro
(assuming it has valid commands inside it), and compile it the first
time you play it after creating it (or after editing it).
If you get an error message when you press Save & Compile, open
Reveal Codes and check the pasted text for long lines that may have
wrapped into two or more lines with a hard return [HRt] or line break
[Ln Brk] between them. Remove the hard return(s) or line break(s)
to "glue" the lines back together.
Play the macro
with Tools, Macro, Play (or Alt+F10).