|
...... |
TECH
TOOLS - OCTOBER
2002 |
...... |
|
WHAT ARE MACROS? |
|
A macro
is a series of commands, keystrokes, and/or mouse clicks
that you save and run whenever you want to. If you find
yourself repeatedly performing a particular task in Word,
Excel, or WordPerfect, you can lighten your workload by
combining the steps into a macro that can be run by clicking
an icon or pressing a key combination. |
|
Creating a
macro... |
You can create a macro by
recording your keystrokes or mouse clicks using the macro
recorder in Word, Excel, or PowerPoint.
The process for recording a macro is very similar in Word,
Excel, and PowerPoint. You open a new document, worksheet,
or presentation and choose Tools, Macro, Record New Macro to
open the Record Macro dialog box. There, you assign your
macro a name, choose a location for it, and give it a
description. Word and Excel let you assign a shortcut key
you can use to run the macro later. Word also lets you give
the macro a toolbar icon.
Once you complete those tasks and click OK to dismiss the
Record Macro dialog box, the Macro Recorder records your
keystrokes and mouse clicks. Just type and click away,
knowing that whatever you do will be recorded in the macro.
You'll notice a tiny floating toolbar that has just two
options: Stop Recording and Pause Recording. To take a short
break, click Pause Recording. Click the same icon when
you're ready to resume. When you're finished recording,
click Stop Recording.
We'll create a simple macro in
Word, (the process is so similar in the other applications
that you can easily create it in Excel or PowerPoint as
well). These general instructions
apply to Word 2002 at least as far back as Word 95, though
the exact steps may vary slightly from
one version to version.
Before creating your macros, be sure each output device you
plan to use is ready to use. It's a good idea to do a trial
run first, walking through the process without recording the
macro. Word's Macro Recorder memorizes every step you
take-including missteps. When you actually create the macro,
you want to record only the steps you need.
You'll also need to have a document ready for printing,
which you'll use while creating and testing your macro.
Let's say your default printer is the HP OfficeJet, and you
want to create a quick option to print to a different
printer let's say a
Lexmark. But you want the default
settings reinstated automatically, so printing will always
be predictable when you use Word's ordinary Print command.
Here are the steps to
creating the macro...
With your test document
created and open, select File | Print (or press Ctrl-P) to
reach the standard Print dialog box. In that dialog box,
select Lexmark from the drop-down Name pick list, and then
click OK to print your document with the new settings. Now
open the Print dialog again, but this time undo the change
by selecting your default printer, and then click the Close
button.
Now you'll need to repeat the process to record it....
Begin by selecting Tools |
Macro | Record New Macro. In the dialog box that appears,
enter a short, descriptive name for your macro (such as
Lexmark) and click OK.
A small box then pops up with
two little buttons. The right button temporarily pauses
recording, if necessary, while the left button stops
recording after you've completed your macro.
Now record your macro - don't
forget to click the Stop button when you're done. The first
few times we used the Recorder, we neglected to do this
until after recording much that was unrelated to the macro.
When we later ran the macro, our reaction could only be
described in words we'd rather not print.
Next, test your macro by
selecting Tools | Macro | Macros, then select the name you
specified and click the Run button. Your document should
print to the desired printer and then reset your default
printer. Just to be sure, test the latter by printing your
document from Word's standard Print command.
You can create macros for
other configurations in much the same way. Just walk through
the process first for practice, then record. Printing to
e-mail or fax is identical to the procedure for a printer if
your e-mail or fax application is listed in the Name pick
list mentioned above. If not, select File | Send To and see
whether Mail Recipient (for e-mail) or Fax Recipient is
listed. If so, you can create a similar macro for that
application, though you may find it just as easy to use the
existing File menu items rather than creating macros for
your new menu. |
|
Creating a
menu... |
|
To create a menu, select Tools |
Customize | Commands. Near the bottom of the Categories pick
list on the left, select New Menu. New Menu will then also
appear in the Commands list on the right. Click and drag the
New Menu on the right to where you want your new menu to
appear on Word's main menu bar.
You'll then want to rename your
new menu to something like Printers.
To do so, right-click New Menu on Word's menu bar
with the Customize dialog box open. In the Name field of the
drop-down menu that appears, type Printers. If you want to
be able to select that menu item with the keyboard shortcut
Alt-P, precede the P with an ampersand-
&Printers.
The procedure for populating
your menu is almost the same as for creating the menu
itself. This time, select Macros rather than New Menu from
the Categories list on the left, find the macro name you
want in the Commands list on the right, and drag the macro's
name onto your new menu.
The first macro you drag onto
the Printers menu will cause a small, gray box to drop down
under Printers. Release the macro you are dragging into that
gray space. (For subsequent macros, drag them to the
Printers menu and then down to the location you want above,
below, or between existing items.) A horizontal black line
reveals where the new menu item will appear when you release
the mouse button. Like the menu name, menu items can be
renamed by right-clicking them and editing the Name box. (Be
sure the Customize dialog box is open.)
Note that preceding any character in the name with an
ampersand makes that character the shortcut key for that
item. You probably shouldn't use the same shortcut key
character for more than one item in a given menu. Otherwise,
the shortcut key will cycle between the items with the
identical shortcut key, and you'll have to press Enter to
activate the right menu item.
You can modify your menus and menu items anytime by
selecting Tools | Customize. Then you can delete a menu or
menu item simply by dragging it anywhere in Word's workspace
other than on a menu bar or toolbar. You can also reorder an
item on a menu by clicking and dragging it until a
horizontal bar indicates the location you want.
Many other menu features are
available. To explore them, open the Customize dialog box,
right-click on the item you want to modify, and play with
the options on the drop-down menu that appears.
With a little imagination,
you can create handy menus with selections that run macros
to speed up almost any Word, Excel, or PowerPoint
feature. |
|
A few
suggestion to keep in mind... |
•
A macro name is limited to 255 characters, must begin with a
letter, and may not contain spaces, periods, or special
characters such as !, @, &, $, or #.
•
Be sure to give your macro a logical, simple name so you
know what it does later.
•
When you determine
a location for your macro, you're saying whether you'll run
it in the current document or in all documents. Most of the
time, you'll want to make the macro available to all
documents. In Word, choose All Documents (Normal.dot). In
Excel, choose Personal Macro Workbook. PowerPoint lets you
store the macro in the open presentation only.
•
When you assign a key combination you'll later use to run
the macro, you must choose one that's not already assigned
to something else (like Ctrl-C, which is assigned to the
Copy command). The Record Macro dialog box will warn you if
you try to take an assigned combination.
•
Finally, it's best to keep things simple. Complex macros
don't always work like you'd expect. |
|
|
|
ONLINE RESOURCES |
|
Whether you use a computer a little
or a lot, you spend a fair amount of time doing some things over
and over again... launching
programs, typing in passwords, signatures, addresses, visiting
the same web site over and over...and more. Repetition is
unavoidable, but you can get around it with EZ Macros.
http://www.americansys.com/ezmacros.htm |
|
With
Macro Express, you can record, edit and play back mouse and
keyboard macros. Its powerful tools will make you more
productive. Macro Express allows a macro to be executed in
several ways. These include the use of Hot Keys, ShortKeys,
Timed Macros, Window Activation and Popup Menus.
http://macros.com/index.htm |
|
|