This browser does not support basic Web standards, preventing the display of our site's intended design. May we suggest that you upgrade your browser?

Microsoft Word 2003/2004

Creating Macros

A macro is a shortcut for performing a series of actions and is useful for automating complex or repetitive tasks. Macros are helpful if the work is being shared with someone else because it is easier to explain how to use a shortcut than it is to explain several steps. For a macro to be worthwhile, the series of actions you wish to accomplish must be consistent.

When creating a macro, planning can be very helpful. Knowing specifically what you want the macro to accomplish and in what order can save a lot of time, editing, and frustration. When the macro is saved, the information is stored as a part of the current template and will be available for all documents based on that template. You can also copy macros to documents based on other templates. For more information on tips for advanced macros and how to run, suspend, or delete macros, refer to Working with Macros.

return to topMacro Tips

As you are creating a macro, you will be requested to assign a name to the macro and to indicate where it will be stored. The following guidelines and tips can help you make the best decision.

Naming a Macro

Macro names must:

Saving a Macro

A macro is saved as part of a template. If you want the macro available whenever you use Word, the macro should be saved as part of the normal.dot template. However, if the use of the macro is limited to specific types of documents and you have a template for that type of document, it should be stored in that template.

Assigning Macros

While it is not required to assign a macro to a second location, doing so can make the macro easier to use and save more time. Depending on your personal style of working with Word, you may want to assign the macro to a keystroke combination, a menu, or a toolbar. You can assign the macro to all three if you want.

Recording Notes

Macros can be created by recording keystrokes (not mouse actions like selecting text) or by writing the macro using the Visual Basic programming language. This document focuses on macros that can be created through the recording method.

WARNING: If you are working with a multi-layer dialog box (one with tabs at the top), only the changes on the current tab are recorded when you click OK. If you want to record changes on more than one layer, you will need to access the dialog box once for each layer, clicking OK as you complete the changes on that layer.

return to topAccessing the Record New Macro Command

You can access the Record New Macro command through a menu or from a toolbar.

Accessing the Record New Macro Command: Menu Option

  1. From the Tools menu, select Macro » Record New Macro…
    The Record Macro dialog appears.

Accessing the Record New Macro Command: Toolbar Option

If you would prefer to have the Record New Macro command available on a toolbar, follow the instructions:

  1. Windows: From the View menu, select Toolbars » Customize...
    The Customize dialog box appears.
    Macintosh: From the View menu, select Toolbars » Customize Toolbars/Menus...
    The Customize Toolbars/Menus dialog box appears.

  2. Select the Commands tab
    Customize dialog box - Commands tab

  3. From the Categories scroll list, select Tools

  4. From the Commands scroll list, click and drag MACROS... and RECORD MACRO/STOP RECORDER... to the Standard toolbar
    NOTE: You may only click and drag a command to the toolbar one at a time.

  5. Windows: Click CLOSE
    Macintosh: Click OK

  6. Windows: On the Standard toolbar, click RECORD NEW MACRO...Record New Macro button
    Macintosh: On the Standard toolbar, click RECORD MACRO
    The Record Macro dialog appears.

return to topCreating & Recording a New Macro

The Record New Macro command of Word creates macros using the Record Macro dialog box. Using this dialog box, you will name, describe, and assign the storage and access locations of the macro(s) you create.

  1. Access the Record Macro dialog box
    The Record Macro dialog box appears.
    Record Macro dialog box

  2. In the Macro name text box, type the name for the new macro
    For information on naming conventions, refer to Naming a Macro.

  3. OPTIONAL: In the Description text box, type a short narrative description for the macro

  4. From the Store macro in pull-down list, select the appropriate option
    NOTE: For more information, refer to Saving a Macro.

  5. OPTIONAL: Assign the macro to a toolbar or keyboard combination
    These options are covered in Assigning Macros to Additional Locations.

  6. Click OK
    The Macro Record toolbar appears in the window with your document.
    Macro Record toolbar

  7. Perform the activity that you want the macro to accomplish

  8. When done, on the Macro Record toolbar, click STOP RECORDING
    OR
    From the Tools menu, select Macro » Stop Recording
    The macro will be saved as part of the template you chose.

  9. Continue with Running a Macro

return to topAssigning Macros to Additional Locations

The following instructions assume that you are assigning the macro to either a keyboard combination or a toolbar as part of the creating process (step 6 of Creating & Recording a New Macro).

Selecting Keyboard Combinations

Many keyboard combinations are already assigned to menu choices and dialog boxes. Below are the potential keyboard combinations you could use for a macro. It is often simply trial-and-error to locate the combination that will work for you.

NOTE: After entering the keyboard combination, a message will appear showing the assignment of the combination.

Windows Macintosh
[Alt] + [Ctrl] + character
[ctrl] + [command] + character
[Alt] + [Shift] + character [ctrl] + [shift] + character
[Alt] + [Shift] + [Ctrl] + character
[alt] + [shift] + character
[Ctrl] + [Shift] + character [command] + [shift] + character

Assigning a Keyboard Combination

The following directions show you how to assign your macro to a keyboard combination.

  1. Access the Record Macro dialog box
    The Record Macro dialog box appears.

  2. Under Assign macro to, click KEYBOARDKeyboard button
    The Customize Keyboard dialog box appears.
    Customize Keyboard dialog box

  3. With your insertion point in the Press new shortcut key text box, press the keyboard combination that you want to use to execute the macro
    NOTE: The shortcut will be displayed in the text box. The action currently associated with the shortcut appears under the text box. If you do not want to override the shortcut's original function, delete it from the text box and press another combination.

  4. Click ASSIGN
    Your shortcut key appears in the Current keys scroll list.

  5. Windows: Click CLOSE
    Macintosh: Click OK

  6. Continue with step 7 of Creating & Recording a New Macro

Assigning to a Toolbar

  1. Access the Record Macro dialog box
    The Record Macro dialog box appears.

  2. Under Assign macro to, click TOOLBARSToolbar button
    Windows: The Customize dialog box appears.
    Macintosh: The Customize Toolbars/Menus dialog box appears.

  3. OPTIONAL: If the toolbar you wish to use is not displayed,
    1. Select the Toolbars tab
      Customize dialog box - toolbars tab
    2. From the Toolbars scroll list, select the toolbar needed

  4. Select the Commands tab

  5. From the Commands scroll list, click and drag the macro name to a desired toolbar

  6. Windows: Click CLOSE
    Macintosh: Click OK
    The Macro Record toolbar appears.
    Macro Record toolbar

  7. Perform the activity that you want the macro to accomplish

  8. When done, on the Macro Record toolbar, click STOP
    The macro will be saved with your template.

  9. Windows: To select an icon for the button,
    1. Right click on the button » select Customize...
      The Customize dialog box appears.
    2. Select the Commands tab
    3. Click REARRANGE COMMANDS...
      The Rearrange Commands dialog box appears.
      Rearrange Commands dialog box
    4. Select Toolbar
    5. From the Toolbar pull-down list, select the toolbar name that contains your macro button
      EXAMPLE: Select the Standard toolbar
      NOTE: Once a toolbar is selected, a list of buttons appears in the Controls scroll list.
    6. From the Controls scroll list, select the button to be assigned to the toolbar
      EXAMPLE: Select Normal.NewMacros.InsPath
      NOTE: You may only modify buttons and not text boxes (e.g., Style, Font, Font Size)
    7. Click MODIFY SELECTION » Change Button Image » the desired image
      The new image now appears on your selected button on the toolbar.
    8. Click CLOSE
    9. Click CLOSE

    Macintosh: To select an icon for the button,
    1. Press [ctrl] and click on the macro toolbar icon » select Properties...
    2. From the Image pull-down menu, select an image
    3. From the View pull-down menu, select the way you would like to see your macro
    4. Click OK
Excellence. Our Measure. Our Motto. Our Goal.