Home Word 2007 Macros Work Faster With Macros
Search MS Office A-Z   |   Search Web Pages/ Design A-Z

Work Faster With Macros

Microsoft Word contains many functions for working more efficiently. We will show you how to use one of those functions, macros, in this and next month’s columns. A macro is a group of operations that Word can execute with a single mouse click or keyboard shortcut. You can create a macro in two basic ways: by recording or by writing a script using the Visual Basic Editor. We will concentrate on recording in these columns.

The Macro Group

The Macro group contains one button and is located on the View tab of the Ribbon. Clicking the top part of the button opens the Macro dialog box, which shows all the built-in macros available in the open document and templates. You can select a macro and click Run to run it or click Create to create a macro using the Visual Basic Editor.

Clicking the bottom half of the Macros button gives you the choice to View Macros, which takes you to the dialog box described above, or Record Macro. Clicking Record Macro opens the Record Macro dialog box.

Let’s walk through the steps to create a macro that changes a selected paragraph of text to a different font, font size, and color and indents it from the surrounding text.

Record The Macro

Note that the macro recorder will record every action you take, so always plan the exact actions you want to record. Because we want this macro to work with text that is already selected, select some text before opening the Record Macro dialog box. It doesn’t matter what you select. If you were to select text after starting the macro recorder, selecting text would be part of the macro, which is not what we want in this case.

Open the Record Macro dialog box. Type a name that you will remember, such as “special blockquote,” into the Macro Name area. Note that macro names must follow certain rules: They can contain only letters, numbers, and underscores (_); they must begin with a letter; and no spaces are allowed. Type a helpful description such as, “This creates special formatting for a blockquote.” in the Description area. This isn’t required but can help you in the future if you don’t recall what you created. Next, decide where you want to store the macro. You can save it either to a template or a document. Click the Store Macros In drop-down box if you want to change the location.

In the Assign Macro To area, you’ll see two options. Clicking the Keyboard button would let you create a shortcut key combination to launch the macro. To create a button for the macro on the QuickAccess Toolbar, click the icon next to the word Button.

This opens the Word Options dialog box. The macro you are about to create is on the left. Its name contains the name you assigned to the macro. To place the new macro on the toolbar, click it to select it and then click the Add button. Click OK at the bottom of the dialog box. The macro recorder has started. You can tell because the cursor has changed to a symbol of a cassette tape (remember those?).

The mouse’s movements are not recorded in the macro, but its actions are. In other words, the macro won’t record the mouse’s movement across the screen, but it will record what it clicks. You can also use keyboard shortcuts in addition to, or instead of, mouse actions. We will use the mouse in this example.

Perform the actions you need to perform to make the changes we described. Let’s change the font first. Click the Home tab, and in the Font group, select Cambria for the font. Change the font size to 12 points. Click the Font Color arrow and choose Dark Red from the palette. In the Paragraph group, click the Increase Indent button once. Now go back to the View tab, click the Macros arrow, and select Stop Recording.

Your macro is complete. Test it by selecting some text and clicking the macro’s button on the QuickAccess Toolbar. Stay tuned next month for a look at a more complex use of macros.



Home Word 2007 Macros Work Faster With Macros
Search MS Office A-Z   |   Search Web Pages/ Design A-Z