- On the Tools menu, point to Macro, and then click Record New Macro.
- In the Macro name box, type a name for the macro.
- In the Store macro in box, click the template or document in which you want to store the macro.
- In the Description box, type a description for the macro.
- If you don't want to assign the macro to a toolbar, a menu, or shortcut keys, click OK to begin recording the macro.
To assign the macro to a toolbar or menu, click Toolbars, and then click the Commands tab. In the Commands box, click the macro you are recording, and drag it to the toolbar or menu you want to assign it to. Click Close to begin recording the macro.
To assign the macro to shortcut keys, click Keyboard. In the Commands box, click the macro you are recording. In the Press new shortcut key box, type the key sequence, and then click Assign. Click Close to begin recording the macro.
- Perform the actions you want to include in your macro.
When you record a macro, you can use the mouse to click commands and options, but not to select text. You must use the keyboard to record these actions. For example, you can use F8 to select text and press END to move the cursor to the end of the line.
- To stop recording your macro, click Stop Recording .
By using Visual Basic for Applications
- On the Tools menu, point to Macro, and then click Macros.
- In the Macros in list, click the template or document in which you want to store the macro.
- In the Macro name box, type a name for the macro.
- Click Create to open the Visual Basic Editor.
Note If you give a new macro the same name as an existing built-in command in Microsoft Word, the new macro actions will replace the existing actions. To view a list of built-in macros in Word, point to Macro on the Tools menu, and then click Macros. In the Macros in list, click Word Commands.