Recording a Macro in MS Word

Recording a macro in MS Word

Double-click REC on the status bar, as seen near the mouse pointer in the figure below, to open the Record Macro dialog box.

Do not be fooled because the button appears to be greyed-out. You can also click Macro on the Tools menu and then click on Record New Macro. Either way will bring up the Record Macro dialog box below.

The Record Macro dialog box

In the Record Macro, Macro name field, type a name for the macro. This name must begin with a letter and contain only letters and numbers — ie must not contain spaces or special characters. Use meaningful names for macros. This is important because you may finish up with many macros and you need to recognise them quickly. It is also advisable to add a description.

You may store the macro in the normal template making the macro available to all Word documents on that computer. Or, you may store the macro in the open document. This makes the macro available only if this document is open. If you create a template from this document, then the macro will be available in any document created with this template.


Caution!

If you want to transport the macro to another computer and you have saved the macro in the normal template (to make it available to all documents) then you will have to copy the macro into another template. It is not wise to copy the normal.dot template from one machine to another because you will destroy all custom settings on that machine.

To include a brief description of what the macro does, type text in the Description field.

If you assign the macro to a menu item or a toolbar button, this description appears in the status bar when you point to the menu item or the toolbar button. A description can contain as many as 255 characters, but only about 100 characters will fit on the status bar.

To assign the macro to a toolbar button, a menu item, or shortcut key, click the appropriate button. When you finish assigning the macro, click Close in the Customize dialog box to begin recording it.

Caution!

Do not close the Stop Recording toolbar. If you do the macro may keep recording without you realising it.

There are two buttons on the Stop Recording toolbar. (See figure below.) The square button is used to stop the recording and complete the macro. The other double-bar and circle button is used to pause and resume the recording.

Perform the actions you want to include in your macro.

The macro recorder cannot record mouse actions in document text. You must use the keyboard when recording actions such as moving the insertion point and selecting text. However, you can use the mouse to click commands and options when you are recording a macro.

To stop recording your macro, click on the square stop button on the Stop Recording toolbar shown in the figure below.

Suspend and resume recording a macro

To suspend recording, click on the double-bar and circle Pause button. Perform the actions you do not want to record.

To resume recording, click the same button once again.

XXX

2005