|
|
|
 |
What do I do with macros sent to me by other newsgroup readers to help me out?
|
I don't know how to install them and put them to use
Article contributed by Dave Rado
Select Tools + Macro + Macros, where it says Macros in, select the
template you want to store the macro in; where it says Macro name, type a
name, and click Create. You will see something like
Sub MyMacroName()
'
' MyMacroName Macro
' Macro created 03/08/00 by Me'
End Sub
You can safely delete the lines in the middle, and add your own code, or
paste in the code sent to you by others. Then select File + Save to save
the macro in your template.
You can run the macro while you are still in the macro-editing window
(normally referred to as the VB Editor or VBE) by pressing F5. You
can also size the VBE and the Word window on your screen so you can see them
both at once, and step through the macro one line at a time, in order to see
what it does, by pressing F8.
To run the macro from within Word, you can press Alt+F8 (or select
Tools + Macro + Macros), find the macro in the list, and press Run.
But
if you are likely to want to run the macro regularly, you can assign
it to a keyboard shortcut, or to a toolbar,
or a menu. Or, depending on what name you give your macro, you can assign it
to certain events see:
Intercepting events like Save and Print
Running a macro automatically when Word starts or quits
Running a macro automatically when a document is created, opened or closed
See also Bill Coan's excellent articles Creating a macro with no programming experience using the recorder
and Getting To Grips With VBA Basics In 15 Minutes.
|