Monday, September 10, 2007

Creating Macros in Microsoft Word 2003 and 2007

Every day you use Microsoft Word, you probably perform at least a few repetitive tasks. From changing multiple formatting options in your document to inserting text, you have the ability to significantly speed up your work through the use of macros.

What is a macro you ask? Simply put, a macro is sequence of actions. You can use Microsoft Word to record a time consuming task in a macro. When you need to perform the task in the future, just run the macro to have Word do it automatically.

- How to Create Macros:

- Microsoft Word 2003

Go into Tools | Macro | Record New Macro:



Name your macro, and select if you want to assign it to a keyboard shortcut or to a toolbar.


(The Record Macro window in Microsoft Word 2003)

If you assign it to a keyboard shortcut, you'll need to type in your shortcut in the window that appears. Using Ctrl+Shift and a letter or Ctrl+Alt and a letter are usually safe to use.


(The Customize Keyboard window in Microsoft Word 2003)

If you assign it to a toolbar, you'll need to drag the command to where you want it, then release:



Next, perform the actions you want in the macro. You may want to do this slowly and deliberately, as everything you do in Word will be recorded. Once you're done, click "Stop Recording" and the macro will be complete:



Test out the macro and make sure it performs as expected (Do make a backup of any file you test it on). If it works, great! You are now using one of the most powerful features of Microsoft Word.

If it doesn't work the way you want it to, you can always delete it by going into Tools | Macro | Macro | Select the macro you want to delete and click Delete. After that, you can try making the macro again.


- Microsoft Word 2007

If you haven't yet turned on the Developer tab, go into Microsoft Word | Office Button | Word Options | Popular | Check "Show Developer tab in the Ribbon" and click OK.


(Enabling the Developer Tab in Word 2007)

Go into the Developer tab, and in the Code group click "Record Macro":



Name your macro, and select if you want to assign it to a keyboard shortcut or to a toolbar. This looks the same as the Record Macro window in Word 2003.

If you assign it to a keyboard shortcut, you'll need to type in your shortcut in the window that appears. Using Ctrl+Shift and a letter or Ctrl+Alt and a letter are usually safe to use.

Perform the actions you want in the macro and click "Stop Recording" in the Code group of the Developer Tab:



Next, test out the Macro and make sure it performs as expected (Make a backup of your test file prior to using the macro, you never know when things may go awry). Should it work the way you want it to, give yourself a pat on the back.

If the macro doesn't do what you want it to, you can always delete it by going into the Developer Tab, then into the Code group and select Macros. Select the macro that doesn't work correctly and delete it, then try making it again.


- References:

office.microsoft.com: Write or record a macro.

homeandlearn.co.uk: Microsoft Word Computer Course.