Macros are basic bits of programming that let you hit a quick button or keyboard shortcut to trigger a pre-recorded action. Here’s how to make easy ones in Word.
What Is a Macro?
A macro is really just a recording of a series of button presses, clicks, and typing. When you record a macro, you just hit record, perform the steps you want to automate, stop the recording, let Word create the programming for you, and then assign the macro to a button or keyboard shortcut. Whenever you want to perform that series of actions in the future, you just activate the macro.
You can use macros for all kinds of things. Honestly, the possibilities are pretty much limitless. For example, you could set up a macro that creates a new footer with your company information, formats the text however you like, and even inserts page numbers. So, why not just do this using a template with some boilerplate text? Well, you can. But what happens when you have an existing document to which you want to add that stuff?
You could also create macros to insert already-formatted tables of a specific size, search for a specific paragraph style, or just insert some text.
We’re going to use the very basic example of inserting some text to walk you through how to record a macro. But use your imagination and experiment. You’ll be surprised how much you can do with them.
How to Record a Macro
First, create a new blank Word document to work in. You’ll be able to save your macros in a system-wide database, so you don’t need to create new ones for each document you work on. In the blank document, switch to the “View” tab on the Ribbon, click the “Macros” dropdown menu, and then click the “Record Macro” command.
Next, give your macro an appropriate name and type a brief description. It’s an important step, especially if you’re planning on making a lot of macros. For our example, we’re going to create a kind of jokey text insertion that types the name: “Lwaxana Troi, Daughter of the Fifth House, holder of the Sacred Chalice of Rixx, heir to the Holy Rings of Betazed”—something we wouldn’t want to type over and over again if it were our full title.
Choose whether to assign your macro to a button or keyboard shortcut. And finally, choose where to store your macro. The default is to store it in Word’s master template (a file named Normal.dotm) so that you can use it in all your documents. But, you can also store it only in the current document if you want. Click the “OK” button when you’re done.
For the sake of this explainer, we’ll show you the creation process for both the button and keyboard. And note that you can always click the “Macros” menu button and edit these settings later if you want to change them.
If you choose the “Button” option, you’re presented with a screen that lets you choose where to store the new button. The default is to place it on the Quick Access Toolbar. Click the name of the macro in the left column, and then click the “Add” button to add the macro to the list of buttons for the toolbar shown on the right. When you’re done, click the “OK” button.
If you’re assigning your macro to a keyboard shortcut, you’ll see the screen below instead. Make sure the name of the macro is selected in the “Commands” pane, click inside the “Press New Shortcut Key” box, and then press the keyboard combo you want to use. You can choose almost any combination of Ctrl, Alt, Shift, and any other primary key, but keep in mind that you’ll need one that isn’t already assigned to a Word or Windows/macOS shortcut.
For our jokey Star Trek macro, we’re going to hold Ctrl, then press L, let go of the L, and then press T—all without releasing Ctrl. The resulting shortcut is expressed as “Ctrl+L,T.” That multi-letter expansion is a way to avoid conflicts with common default shortcuts. When you’re done, click the “Assign” button, and then click the “Close” button.
Now, you’re placed back in the main writing interface of Word. The program is in recording mode, so perform any actions you like. You can click buttons, open menus, insert objects—you name it. Word watches and records whatever you’re doing as a macro. And don’t worry about taking your time. Word doesn’t really duplicate these actions at the speed you’re performing them. Instead, it takes the actual actions you make, and creates a script to run them.
For our example, we’re just repeating our rather nerdy name and title:
While creating your macro, you can click the “Pause recording” button if you need to adjust something or make some quick notes. Click the “Resume recorder” button to continue working on your macro.
When you’re done, open the “Macros” dropdown menu again, and then click the “Stop recording” command.
That’s it. Word creates a macro from your recording and saves it as a button or keyboard shortcut (whatever you decided).
To run the macro, click the button you assigned or the hit the keyboard shortcut you defined. If you chose the button option, you’ll see your macro button in the “Quick Access Toolbar” at the very top of the window.
Obviously, this is a super simple example we’ve given you. You can use Word to create some pretty sophisticated macros. Advanced users can even manually program their own (or manually tweak their recorded macros). But this guide should at least get you started creating some basic macros.
Image credit: Mopic/Shutterstock