November
1997 Macro Q&A
Finding the region name of a control on a WordPerfect dialog
Q. I've noticed many macro commands require a region name as a parameter. How do
you find the names of regions on dialogs?
A. There are two ways to get the region name. First, you can refer to the Appendix
in my book for a list of region names. Second, you can make a modification to your
Registry files that allows you to get the region name via the online help system.
To make this change, exit WordPerfect if you are in it. Edit the Registry by clicking
the Start button on the Windows task bar. Choose Run. Type regedit and press
(Enter). Once in the Registry, double click HKEY_CURRENT_USER, then Software, then
PerfectOffice, then PerfectFit. Under this key, right-click Help. Choose New, then DWORD
Value. Type Help Information as the name of the new item, and press (Enter). Double-click
the new item and type 1 in the Value data edit window. Choose OK, then exit the Registry.
Now, go back into WordPerfect to find the name of a particular region. Get to the place
where you can click on the region you want the name for. Press Shift+F1. A mouse pointer
with a question mark will appear. Click the item you want the name for. If the item is a
menu item, drag the mouse cursor until you get to the item, then release the mouse.
A Help Information dialog will appear with information about the item you chose. The
Keyword item is where you will find the region name. A complete region name is made up of
the application name, the object name (such as Menu or a dialog name), and the region name
listed under Keyword in the Help Information dialog. So, if you clicked on the Left margin
entry window on the Margins dialog, you'd get the Help Information dialog listing the
region name for the item as WordPerfect.Margins.LeftMargin.
Region names are case-sensitive.
CoachAnimate Errors
Q. I am using a CoachAnimate command to move the mouse pointer to a specific
control on a dialog. The macro compiles fine, but when I play the macro, I get an error
message saying an error occurred at the CoachAnimate command. What could be wrong?
A. You've probably mispelled the region name. Named regions are case-sensitive.
Check the region name againa nd make sure it is spelled exactly like it is in the Help
Information screen, including all uppercase and lowercase letters. Also make sure that you
have included to action to be performed at that region, such as "click on " or
"move to ". The entire specification should be included in quotation marks.
If you have a question about PerfectScript or WordPerfect for DOS macros, you may submit
it may emailing me.
Include the words PSJournal-Question in the Subject line.
Sorry, I can't publish or acknowledge all submissions. All submissions become the
property of PerfectScript Journal.
Contents Copyright © 1997 by J. Jeppson.