Microsoft Word online training course

Word lesson 27, Macros

Making a macro

First of all for those who dont know what a macro is, a macro is a set of automated actions that executes one or multiple tasks by simply clicking a button.
A macro remembers the actions that you do on your keyboard and saves this as a visual basic module.
When we want to repeat these actions at a later time, we just need to push a button.
For example: you need to insert a name, address, fax and phone number on every page of your document.
It would be usefull if we only need to type this information once and save it as a macro.

To make a macro we use the macro.
To go here click on "Tools", "Macro" and "Record macro" in the menubar.
This will open the "Record macro" window.
In the first field we give the macro a name (your not allowed to use spaces in a macro name).

We don't touch the second field "Store macro in".
Because the macro can only be executed when it is attached to the document.

In the third field we can give a description for the macro.

record macro
Click on "Ok" when you are done.
Every key you push on your keyboard will be recorded now.
A small "Record" toolbar will open now.

record toolbar
Click on the "Stop recording" button when you are done.
Thats all you need to do to record a macro.

"Run" macro

To "Run" the macro we first place the cursor inside our document where we want to execute the macro.
Then we click on "Tools", "Macro" and "Macros" in the menubar.
We select the macro in the newly opened window and click on the "Run" button.
The macro will be executed, easy right ?

Keyboard shortcut for macro

To assign a keyboard shortcut to a macro we click on "Tools" and "Customize" in the menubar.
Click on the "Keyboard" button on the bottom of the window.
Select the macro which you want to assign a keyboard shortcut to.
Next click in the "Press new shortcut key" field and type a combination of keys for your shortcut.
If you enter a keyboard shortcut that allready exists, this one will be overwritten.

customize keyboard window
Click on "Close" twice to return to your document.