Create a macro

Microsoft Office Word 2003

  1. On the Tools menu, point to Macro, and then click Record New Macro.
  2. In the Macro name box, type a name for the macro.
  3. In the Store macro in box, click the template or document in which you want to store the macro.
  4. In the Description box, type a description for the macro.
  5. 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.

  6. 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.

  7. To stop recording your macro, click Stop Recording Button image.

ShowBy using Visual Basic for Applications

  1. On the Tools menu, point to Macro, and then click Macros.
  2. In the Macros in list, click the template or document in which you want to store the macro.
  3. In the Macro name box, type a name for the macro.
  4. 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.