Pages

Wednesday, June 15, 2011

Word Tip Wednesday: Macros

Update 6/7/13: There is an error in this tutorial regarding the highlight feature. There are notes in the comments on the correct way to do it. I will be updating the post soon. Thanks goes to Serena Yung for pointing out that it wasn't working. :)Today’s topic will be easier if you’re familiar with Find and Replace, since I will be using those as part of my example.

Macros might seem a little scary, but once you understand what they are and how they work, I think you’ll find they’re actually quite easy to use and very useful, especially during revisions. Basically, it’s a recorded set of steps that can be accessed by a shortcut key, a button on the toolbar, or by selecting from a list.

With this feature, I recommend reading through all the instructions before trying any of it. It will probably be less confusing that way.

The macro options are under the Developer tab.* By default, this tab is turned off in MS Word 2007, so first, you’ll need to turn it on. To do this, click the Office button in the top left corner (Figure 1).

Figure 1

Select Word Options at the bottom of the menu (Figure 2).

Figure 2

In this menu (Figure 3), select Popular in the left column and check the box next to Show Developer tab in the Ribbon. Then click OK.

Figure 3

You should now have the Developer tab in your Ribbon (Figure 4).

Figure 4

First, click the Record Macro button (Figure 5).

Figure 5

This menu will pop up (Figure 6). Enter a name in the Macro name: box. You can also add a description in the bottom box if you want.

Under Store macro in: you can choose to have it apply to all documents or just the one you are currently working with.

﻿

Figure 6

Under Assign macro to (Figure 6),you can choose to access the macro through a Button (Option 1) on your Quick Access toolbar or through a Keyboard shortcut (Option 2). If you don’t select one of these options and just click OK from this menu, it will immediately begin recording your macro. In this case, after you have recorded your macro, you will have to go to the Macros button (Figure 7) under the Developer tab and select it from a list (Figure 8) and click Run every time you want to use it (Option 3).

Figure 7

Figure 8

Note: This window (Figure 8) is also where you go to Edit your macros, but editing macros requires editing code, so unless you’re familiar with code, I wouldn’t attempt this. If there is problem with one of your macros, the easiest thing will probably be to Delete the macro and record it again.

Option 1: In the Record Macro window (Figure 6), choose Button under Assign macro to, it will go to this screen (Figure 9). Select the macro from the list in the left column, click Add>> and it will add it to the right column, which lists all the buttons in your Quick Access menu (this shows to the right of your Office button (Figure 1)). You can change the icon for the macro by selecting the macro and clicking Modify. Then click OK to begin recording your macro.

Figure 9

Option 2: In the Record Macro window (Figure 6), choose Keyboard under Assign macro to (Figure 6), and it will go to this screen (Figure 10). In the Press new shortcut key: box, press the keys you want to assign to the macro (pressing the Alt key at the same time as another key will enter “Alt+whatever key you pushed” and the same works for the Ctrl key). It will show you if that shortcut is already assigned to something else next to Currently assigned to:. Once you’ve chosen your shortcut, click Assign to begin recording your macro.

Figure 10

Now that you’ve clicked OK or Assign, you are in record mode, and it will continue to record until you click Stop Recording.

You can record anything with a macro. For today’s tip, we’re going to create a button to highlight overused words. So, using the Find feature, follow the steps to highlight any overused word(s) (Figure 11). See this post for more detailed instructions.

At this point, all instances of overused words should be highlighted in your document. Now go back to the Developer tab and click Stop Recording (Figure 12). Note: It will continue to record until you click Stop Recording so it’s very important not to miss this step.

Figure 12

Quick review of the steps:

Click Record Macro under the Developer tab.

Select your preferred method to access the macro (button, keyboard shortcut, or list) and complete the steps to set up that method.

Complete the steps for the function you would like to record—highlight words, format changes, font changes, etc. Anything that Word can do, you can record in a macro.

Click Stop Recording.

Now, if you chose the Button (Option 1) as you were setting it up, all you have to do to highlight all your frequently overused words in future documents is click on the button in your Quick Access menu (Figure 13). It might look different, depending on which icon you chose.

Figure 13

If you chose Keyboard (Option 2) as you were setting it up, then when you want to run the macro, just type in the keystrokes you selected. In this case, I chose Alt+Z.

Now you’re ready to set up macros for anything you do frequently in Word.

Hi Abby, don't know if you're still reading this since this was 2 years ago, lol.

I followed your instructions for making a macro for highlighting specific words. But for some reason, clicking on my macro button doesn't automatically highlight those words. In fact, it doesn't do anything at all!

What version of Word are you using? I'm not sure why that would be an issue unless you're using a really old version, but thought I'd check, just in case. :)

Other than that, the only thing I can think of is that you missed a step (or I missed a step). I'll run through it and see if it works by following the steps exactly. I'll get back to you when I'm done. I have to run out for a bit, so it might be a while but I won't forget you.

And if you can give me any more info, that would be great. I understand that there's probably no more info to give, so if you can't, no big deal. We'll figure it out. :)

Oh it does seem to be working! I also accidentally made it record my opening another document (where I had all my keywords listed) and closing it, and reopening (maximizing) my original document, etc. I really have to remember to pause the recording while I do these things! ^^"

Oh, by the way, I heard we can copy and paste all of the sentences (that the highlighted words are in) onto another Word doc, as Jordan McCollum pointed out http://jordanmccollum.com/2012/07/mass-editing-word-macros/ (this is where I found the link to your page. :) )

But is there a way to do this using the "record" function? (Instead of using the Visual Basic code?)

LEGACY OF THE EMPRESS by Rebecca Knight

Now available on Amazon

Blog Awards: Thank You!

Bloggy Badges

Total Pageviews

“Our deepest fear is not that we are inadequate. Our deepest fear is that we are powerful beyond measure. It is our light, not our darkness that most frightens us. We ask ourselves, Who am I to be brilliant, gorgeous, talented, fabulous? Actually, who are you not to be? You are a child of God. Your playing small does not serve the world. There is nothing enlightened about shrinking so that other people won’t feel insecure around you. We are all meant to shine, as children do.” ~Marianne Williamson, A Return To Love