How to create and record a Macro in MS Word 2007/2010

Printer-friendly versionPrinter-friendly versionSend by emailSend by emailPDF versionPDF version

What is a Macro?

By common definiton, a macro is just a shortcut to severak tasks that you do repeatedly. For instance, you are working with a document with a lot of tables.

recording word macros

In each table, you format the headings by giving it a background color of Gray 25%, and you make the text bold and center. If there are 100 tables in your 125-page document, then you need to repeat formatting of the table headings 99 times.

You do not need to manually format the table headings of the 99 tables. You can just record a macro, then format the headings of the first table. Then end the macro recording, then run the macro to format the rest of the tables, that is, the remaining 99 tables. This will be done in less than three (3) minutes depending on the formatting that you apply to the table heading and on the speed of your computer.

The logic here is that, as you record a macro, all the things that you do in the document will be recorded and when you run the macro, Word will just do the recorded tasks. It serves as an automation of repeatedly done tasks. If you are familiar with Visual Basic programming, you can use your programming skills to modify your macro to fit your automation requirement.

To start recording a macro in MS Word 2007 or 2010, here are the steps:

Step 1: Open your MS Word and make sure that the Developer tab is enabled or shown. If you do not have the Developer tab, please click on this link for the procedures to show or enable the Developer tab: How to show the Developer Menu/Tab in Microsoft Word 2010

Step 2: Click on the Developer tab to show the various commands and options available. In the Code group, click on Record Macro.

Word record macro

Step 3: In the dialog box that opens, give your Macro a name. Make the name a little bit descriptive of what the macro does. For instance, if it formats paragraphs, you can name it as Format_Paragraphs.

Step 4: You can also assign a keyboard key combination or a button to your macro. This means that if you press that button or the key combination, your macro is executed.

Step 5: Under "Store macro in" options, you have the option to save the macro to the current document, or to the global document template. When it is saved to the current document, it will only execute inside that document. It is not present in other documents. If you store it to the global document template called Normal.dotm, the macro is available and can be run in any other documents in your computer. You make your options.

Word macro dialog

Step 6: Then click on OK. You will then notice that your mouse pointer will then become a recorder icon. This indicates that you are in the macro recording mode.

Step 7: Please note that 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 record these actions. For example, you can use F8 to select text and press END to move the cursor to the end of the line. For more information on how to use the keyboard while in Macro-recording mode, click on this link:

Using Keyboard in Macro-Recording Mode

Step 8: You can pause or stop the recording any time using the appropriate button in the Code group in the Developer tab.

Step 9: To run the macro, in the Code group in the Developer tab, click on Macros and there you shall see your recorded macro. Then click on Run.

MS Office Software: