MS Word: Creating Macros
MS Word: Creating Macros
Macros can be a real timesaver for editors. These are mini-programs you can use to run procedures you usually do manually in Word. They are written in Visual Basic, but don't worry! You don't need to be a programmer to record and use macros. You don't even have to be that technically inclined.
Why should you use macros? First, a macro can quickly complete a task that might take you hours. Second, using a macro ensures the results are accurate and consistent. For example, a common macro is to search for two spaces and replace all instances with one space. The macro does this in a flash, while you might comb through the document for hours and still miss spacing inconsistencies. Automating repetitive tasks by running a macro saves you valuable time, time that can be used for the fun stuff of editing—stuff the computer can't do—like content analysis, structural editing, and the subtleties of style and tone. Let the computer do the boring stuff!
There are a few ways to approach macros: you could write them in Visual Basic, use macros someone else has written, or record your own. Let's assume the first option is out—instead, you can use complicated macros that other people have written. There are many free macros out there; just do a quick Internet search and you'll find them. But the most valuable and easiest option for the non-technically inclined editor may be the third one—record your own.
Recording your own macro is easy. Basically, you just press record, and go through the motions you want the macro to do. For example, to record a macro that would replace double with single spaces, you would record the following sequence: click Replace, type two spaces in the Find what box and one space in the Replace with box, and then click Replace All.
Before you start recording macros, you need to evaluate which ones would be valuable to you. The best way to do this is to keep track of the things you do over and over again (looking at your documented process may help with this). The following are some potential candidates for automation:
Turn on Track Changes
Change double spaces to single spaces
Create an em dash, an en dash, or a bullet point
Change improperly typed ellipses
Zoom the page to fit the window
Apply Heading 1, 2, or 3
Save file with a _REVISED ending
Change underlining to italics
Accept all changes
Change straight quotation marks to curly ones
Change a double hyphen to an em dash
Once you've decided what macros you want to make, plan them out. Write down the steps you want to follow, because a macro is only as good as the recording. If you make a mistake during the recording, you'll have to start over. A macro plan for the spacing issue might look like this:
Click Replace
In the Find what box, press the space bar twice
In the Replace with box, press the space bar once
Click Replace All
When you're ready, go to the View tab and click Macros. A dropdown menu will appear. Click Record Macro, and a box will appear. Name your macro something intuitive, like RemoveSpaces for the example macro, click OK, and perform the planned-out steps. Then go back to View, and click Stop Recording. It's that easy!
There are a few different ways to get to your macro now that it has been recorded. You could go to View, Macros, and then View Macros. Select RemoveSpaces from the list and click Run, but this is too much clicking.
Alternatively, you could assign a button that will appear in your Quick Access Toolbar. To do this, go to your Quick Access Toolbar, which is located in the top left corner of the screen. Click the down arrow, and then More Commands. A box will pop up. Where it says "Choose commands from," instead of popular commands, select Macros. A list of your macros should appear. Click the one you want to create a button for, and then click Add. It will appear in your toolbar now. You may want to change the button’s appearance. Click your macro on the right side of the popup box and then click Modify on the bottom. A range of button choices pop up.
Select the one you want and click OK. Then, back in the Quick Access Toolbar popup, click OK. You should see your chosen button in the Quick Access Toolbar.
If you use more than one or two macros, your Quick Access Toolbar starts looking cluttered, and it may be hard to remember which buttons belong to which macros—assigning keyboard shortcuts is really the best way to go. It may seem like a lot to remember at first, but keyboard shortcuts, once memorized, are much easier than buttons. You don’t even have to take your hands off the keyboard! To assign a keyboard shortcut to your macro, go to Word Options and then Customize Ribbon. Click "Keyboard shortcuts: Customize" on the bottom left. A popup will appear; scroll down to Macros on the left, and your macros should appear on the right. Click one. Under Assign new shortcut, press the keystroke you want to assign. Make sure that under Current keys it says Unassigned, as you don’t want to be replacing another shortcut you use. Click Assign. Done!
Make sure you try out your macros on test documents to ensure they're working properly before using them on documents you're editing. Always keep backups of your macros in a macros template so you won't have to rerecord everything if you lose them. All you need to do is go into the Edit Macros window, copy the coding for your macros from Visual Basic, and paste them into an .rtf file that you then save in a secure place.
Editors have a tendency to get set in their ways, and it sometimes feels easier to stick with the older, more labor-intensive ways of doing things than to invest time in learning and setting up something new. Editors will spend thirty minutes doing something manually, every time, rather than taking ten minutes to set up a macro that can be used time and time again. Resist this temptation! Take the time to set up some macros; you'll save time in the long run.
Last Updated: 10/01/2022