In Microsoft Office Word, you can automate frequently used tasks by creating macros. A macro is a series of commands and instructions that you group together as a single command to accomplish a task automatically.

Typical uses for macros are:

You can use the macro recorder to record a sequence of actions, or you can create a macro from scratch by entering Visual Basic for Applications code in the Visual Basic Editor .

Note To work with macros in Office Word, you need to show the Developer tab.What do you want to do?

Show the Developer tab

  1. Click the Microsoft Office Button button image, and then click Word Options.
  2. Click Popular.
  3. Under Top options for working with Word, select the Show Developer tab in the Ribbon check box.

Use the macro recorder

  1. On the Developer tab, in the Code group, click Record Macro.
  2. In the Macro name box, type a name for the macro.

    Note If you give a new macro the same name as a built-in macro in Office Word, the new macro actions will replace the built-in macro. To view a list of built-in macros, on the Developer tab, in the Code group, click Macros. In the Macros in list, click Word Commands.

  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 of the macro.
  5. Do one of the following:
    • To begin recording the macro without assigning it to a button on the Quick Access Toolbar or to a shortcut key, click OK.
    • To assign the macro to the Quick Access Toolbar, do the following:
      1. Click Button.
      2. Under Customize Quick Access Toolbar, select the document (or all documents) for which you want to add the macro to the Quick Access Toolbar.
      3. Under Choose commands from dialog box, click the macro that you are recording, and then click Add.
      4. Click OK to begin recording the macro.
    • To assign the macro to a keyboard shortcut, do the following:
      1. Click Keyboard.
      2. In the Commands box, click the macro that you are recording.
      3. In the Press new shortcut key box, type the key sequence that you want, and then click Assign.
      4. Click Close to begin recording the macro.
  6. Perform the actions that you want to include in the macro.

    Note 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 select text. For more information about selecting text by using the keyboard, see .

  7. To stop recording your actions, click Stop Recording in the Code group.

Use Visual Basic for Applications

  1. On the Developer tab, in the Code group, click Macros.
  2. In the Macro name box, type a name for the macro.

    Note If you give a new macro the same name as a built-in macro in Office Word, the new macro actions will replace the built-in macro. To view a list of built-in macros, click Word Commands in the Macros in list.

  3. In the Macros in list, click the template or document in which you want to store the macro.
  4. Click Create to open the Visual Basic Editor.