MS Office Videos Tutorials
Other Website Links
Google Links
Record and run a macro in microsoft word
Press play 2 times! to watch it on video:
Double click video for full screen viewing
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.
- Macro Tips
- Accessing the Record New Macro Command
- Creating & Recording a New Macro
- Assigning Macros to Additional Locations
Macro 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:
- begin with a letter
- contain no spaces
- contain no unusual characters (e.g., @, %, &, ^)
- have the appropriate name from the following list to run automatically:
AutoExec The macro runs when Word is opened AutoExit The macro runs when you exit Word AutoOpen The macro runs when you open a document AutoNew The macro runs when you create a new document AutoClose The macro runs when you close the current document
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.
Accessing 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
-
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:
-
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. -
Select the Commands tab
-
From the Categories scroll list, select Tools
-
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. -
Windows: Click CLOSE
Macintosh: Click OK -
Windows: On the Standard toolbar, click RECORD NEW MACRO...

Macintosh: On the Standard toolbar, click RECORD MACRO
The Record Macro dialog appears.
Creating & 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.
-
Access the Record Macro dialog box
The Record Macro dialog box appears.

-
In the Macro name text box, type the name for the new macro
For information on naming conventions, refer to Naming a Macro. -
OPTIONAL: In the Description text box, type a short narrative description for the macro
-
From the Store macro in pull-down list, select the appropriate option
NOTE: For more information, refer to Saving a Macro. -
OPTIONAL: Assign the macro to a toolbar or keyboard combination
These options are covered in Assigning Macros to Additional Locations. -
Click OK
The Macro Record toolbar appears in the window with your document.

-
Perform the activity that you want the macro to accomplish
-
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. -
Continue with Running a Macro
Assigning 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.
-
Access the Record Macro dialog box
The Record Macro dialog box appears. -
Under Assign macro to, click KEYBOARD

The Customize Keyboard dialog box appears.

-
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. -
Click ASSIGN
Your shortcut key appears in the Current keys scroll list. -
Windows: Click CLOSE
Macintosh: Click OK -
Continue with step 7 of Creating & Recording a New Macro
Assigning to a Toolbar
-
Access the Record Macro dialog box
The Record Macro dialog box appears. -
Under Assign macro to, click TOOLBARS

Windows: The Customize dialog box appears.
Macintosh: The Customize Toolbars/Menus dialog box appears. - OPTIONAL: If the toolbar you wish to use is not displayed,
- Select the Toolbars tab
-
From the Toolbars scroll list, select the toolbar needed
- Select the Toolbars tab
-
Select the Commands tab
-
From the Commands scroll list, click and drag the macro name to a desired toolbar
-
Windows: Click CLOSE
Macintosh: Click OK
The Macro Record toolbar appears.

-
Perform the activity that you want the macro to accomplish
-
When done, on the Macro Record toolbar, click STOP
The macro will be saved with your template. - Windows: To select an icon for the button,
- Right click on the button > select Customize...
The Customize dialog box appears. - Select the Commands tab
- Click REARRANGE COMMANDS...
The Rearrange Commands dialog box appears.
- Select Toolbar
- 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. - 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) - Click MODIFY SELECTION > Change Button Image > the desired image
The new image now appears on your selected button on the toolbar. - Click CLOSE
-
Click CLOSE
- Press [ctrl] and click on the macro toolbar icon > select Properties...
- From the Image pull-down menu, select an image
- From the View pull-down menu, select the way you would like to see your macro
- Click OK
- Right click on the button > select Customize...
