The Anchorage
Personal website of Gregory K. Maxey, Commander USN (Retired)
The information, illustrations and code contained in my "Microsoft Word Tips" are provided free and without risk or obligation.
However, the work is mine. If you use it for commercial purposes or benefit from my efforts through income earned or time saved then a donation, however small, will help to ensure the continued availability of this resource.
If you would like to donate, please use the appropriate donate button to access PayPal. Thank you!
The purpose of this Microsoft Word Tips & Microsoft Word Help page is to explain and show how you can create and begin using macros using the recorder with no previous programing experience.
The macro recorder in Microsoft Word can be used to acquaint yourself with VBA procedures and the Office Visual Basic for Applications programming language.
Note: This tips page, illustrations and examples were developed using Word 2016. Techniques are similar and applicable to Word 2007\2010\2013.
For a very basic demonstration (see General Note 1 at the end of this tips page), let's assume that you create several documents each day from scratch. After composing the text you perform the following steps:
In time, you ponder how you could automate the repetitive steps of returning to the start of the document and centering the first paragraph. You need a "macro" but you don't know how to create one.
Note: The record icon is displayed when the cursor is within the document boundaries to indicate Word is recording the user's actions. Unfortunately, and increasingly as Word has advance, many user actions are restricted while recording.
To view and edit your first macro, you have to see behind the scene or look under Word's hood. Recorded macros (like all Word macros) are stored in a VB project of a template or the document itself. To access the VB project:
In the VB Editor that opens you will see code similar to this:
If you have the patience to try these steps, you'll be well on your way. The rest is just details gained through experience. There are lots of them but you can always search the web for VBA help or participate various Word VBA support forums. For tips on editing and refining recorded macros see: How to Modify a Recorded Macro
General Notes:
1. In practice the correct method for centering a paragraph is using a centered paragraph style.
2. For Word 2010/2013/2016 the Developer tab can be displayed using File>Word Options>Customize Ribbon and checking the box adjacent to "Developer" in the Main Tabs dialog. For Word 2007 the Developer tab can be displayed using Office button>Word Options>Popular and checking the box "Show Developer tab in ribbon."
3. If configured in your Word status bar settings, the macro recorder can be initiated and recording stopped using icons displayed in the status bar.
4. Recorded macros are stored by default in a standard module "NewMacros" in the user's normal template. By user selection, they can be stored in directly in the open document.
That's it! I hope you have found this tips page useful and informative.
The information, illustrations and code contained in my "Microsoft Word Tips" are provided free and without risk or obligation.
However, the work is mine. If you use it for commercial purposes or benefit from my efforts through income earned or time saved then a donation, however small, will help to ensure the continued availability of this resource.
If you would like to donate, please use the appropriate donate button to access PayPal. Thank you!