Resting Anchor

The Anchorage

Personal website of Gregory K. Maxey, Commander USN (Retired)

Create a Macro Using The Recorder
(A Microsoft Word Help & Tip page by Gregory K. Maxey)

DISCLAIMER/TERMS OF USE

The information, illustrations and code contained in my "Microsoft Word Tips" are provided free and without risk or obligation.

Click to acces PayPal Verification Service Click to acces PayPal Verification Service

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!

Click to donate British Pound Sterling                   Click to donate US dollars                   Click to donate EU euros

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.

Site Note iconNote: 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.

Record Macro

To get started, you can record one. Proceed as follows:

recored_macro_1
record_macro_2
Assign to QAT Button

record_macro_3
Assign to QAT buton

record_macro_4
Assign to keyboard

You are now ready to record the repetitive steps:

record_macro_5

Site Note IconNote: 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.

Test the macro

View/Edit Your First Macro

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:

record_macro_6

In the VB Editor that opens you will see code similar to this:

record_macro_7

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

Site Note Icon 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.

Share

DISCLAIMER/TERMS OF USE

The information, illustrations and code contained in my "Microsoft Word Tips" are provided free and without risk or obligation.

Click to acces PayPal Verification Service Click to acces PayPal Verification Service

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!

Click to donate British Pound Sterling                   Click to donate US dollars                   Click to donate EU euros

Search my site or the web using Google Search Engine

Google Search Logo