You can create a macro to save time. A macro combines a series of actions into a single command. For example, you can store in a macro repetitive text that you type frequently so that you can insert it quickly and easily.
You create a macro by recording the keystrokes you use to take the action you want to store in the macro.
Click Tools.
Click Macro.
Click Record New Macro.
The Record Macro dialog box appears.
Type a name for the macro.
The default description for the macro appears here.
You can add to the description or type a different description for the macro.
Click Keyboard to assign the macro to a keyboard shortcut.
Are there any rules I should follow when naming a macro?
Macro names must begin with a letter and contain no spaces. In addition, if you think you may want to view the macro code, you may find it easiest to locate the macro if you name the macro something meaningful to you.
Can I assign a macro to a toolbar button?
Yes. In step 5, click Toolbars instead of Keyboard. The Customize dialog box appears. Drag the macro from the Commands list to a toolbar. See the section “Add Buttons to a Toolbar” for details. You can rename the toolbar button by right-clicking it and changing the information in the Name box. Then, complete steps 8 to 10 on the pages that follow.
By assigning the macro to a keyboard shortcut, you can quickly and easily run the macro.
The Customize Keyboard dialog box appears.
Press and hold the key and press a letter or number.
The current assignment for the key combination you selected appears here.
If anything other than [unassigned] appears, press and repeat step 6 using a different key combination.
Click Assign.
The key combination appears here.
Click Close.
The Stop Recording toolbar appears.
REC appears in the status bar.
The mouse changes to .
Perform the actions you want included in the macro.
Note | Macros can include typing, formatting, and menu or toolbar commands. You cannot use the mouse to position the insertion point. |
You can click the Pause Recording icon () to temporarily stop recording and then click the icon again to resume recording.
Click the Stop Recording icon () when you have taken all the actions you want included in the macro.
Word saves the macro, the Stop Recording toolbar disappears, and REC disappears from the status bar.
How can I view the macro code?
Follow these steps:
Perform steps 1 to 3 in this section, clicking Macros in step 3.
In the Macros dialog box that appears, click the macro.
Click Edit.
The macro code appears in a Visual Basic window.