Macros are little programs that run within another program, such as Word. They are what hides behind the icons on the ribbon, making them do things. You can make macros to automate any routine task; even complicated ones like creating a stylesheet or imposing one.
How to Create Macros
You don’t have to learn to code! Visual Basic is the programming language that macros use but, for one, Word has a recording function that will create a macro based on your actions. The other reason you don’t have to learn code is that many macros are shared online by generous and knowledgeable people; you can use those.
What Macros Can Do
You do have to be careful where the macros come from since they are code and can be made to do just about anything to your computer, even from within Word.
I use macros to:
- start comments, complete with sentence stems addressing the author
- add words to my stylesheet without leaving the document
- apply stylesheet preferences
- flag problem words
- do any routine typing, such as inserting catch lines for art
- use wildcards for find and replace while also tracking changes
Editing the Macros
Though you don’t have to learn to code, it does help to know your way around the code so that you can tweak it to your preferences or assemble two parts of code into a new macro. Sometimes code will even look so familiar that you can figure out what it does. For example, this line controls the boldfacing of text:
Selection.Font.Bold = wdToggle
You might guess from the last term that this code will toggle boldface on or off, just like the icon on the ribbon. You can make that change absolute rather than relative by replacing “toggle” with either “true” or “false,” like so:
Selection.Font.Bold = True
Same goes for italics:
Selection.Font.Italic = wdToggle
Tracking changes is another option that uses the toggle command. To force changes on or off you need to change the command to true or false, just as above. What this command allows you to do is track changes while using wildcards in find and replace. Without a macro, tracking changes messes up wildcard find and replace attempts. Just insert these four lines of code at the top of the macro:
.TrackRevisions = True
.ShowRevisions = True
Accessing Your Macros
Macros are accessed through an icon on the ribbon. There is one in the View ribbon (shown above). If you use a Mac, you’ll want the full functionality found on the Developer ribbon, which is hidden by default.
You can select a macro from the list that opens when you click the Macros icon, and then click Run or Edit. Clicking Edit is a way to get into the code so you can paste any macro into your system or tweak the code that is there.
Learn more in our Master Class: Macros without Tears. Thursday, April 20, 2017, 11 am–12:30 pm EST