Did you know that the frequently repeated actions in the latest Word text editor (2007, 2010, 2013, 2016) can be automated? This is achieved by creating macros in Word. What is it, how to make them, enable / disable, how to open a file with such elements, we will definitely analyze further.
What are these macros in Word?
A macro is a set of instructions that are grouped into a single command to automatically complete a task. They are written in Visual Basic in an editor of the same name.
Most often, macros are used by the user for:
- Acceleration of the most popular formatting and editing actions.
- Combining several teams into one. As an example, create a table with a certain number of columns, rows, border style.
- Facilitate access to the options found in the dialog boxes.
- Automate the processing of sequential complex operations.
Thus, macros in Word turn several tasks into one action. To implement it, you must type a combination of keys or click on the button on the quick access panel.
Word 2010-2016: recording a macro triggered by a button
Let's see how to create a macro in the Word of this type:
- Go to "View", select "Macro" - "Create ...".
- Come up with a name for this set of commands.
- If you want to use it for all files, be sure to select the "For all documents" accessibility.
- Click on the "By button" assignment.
- In the next window, click on the new macro. Its name will begin with Normal - NewMacros, after which the name you designated it will follow.
- Next - click on "Add", and then on "Change."
- From the suggested palette, select the icon for your macro in Word.
- Now the most important part: recording steps. For each you need to select a command or press a specific key. Text must be selected using the keyboard. The system will record all the steps that you will do - keystrokes, mouse actions.
- When you complete your plan, end the recording: by going to the "Macros" section, select "Stop ..."
You will see that a button for the command you created appears on the quick access panel. By clicking on it, you will automatically perform the recorded sequence of actions.
Word 2010-2016: recording a macro that is launched with a key combination
Now we’ll look at how to create a macro in Word, which is activated by pressing a combination of buttons:
- Go to "View", find "Macros". Next - "Record ..."
- Enter his name. Do not forget to indicate, if necessary, that the macro is available for all documents.
- Select the keyboard accessibility icon.
- In the "New Shortcut ..." field, enter a specific key combination that will trigger the macro. If it coincides with another standard command, then you need to come up with a different combination.
- Click on "Assign."
- Now recording the steps for the macro: for each of them set a specific command, click. All actions will be saved by the system.
- When everything is ready, go to "Macros" (menu "View") and stop recording.
Now, with the established keyboard shortcut, you can activate the created set of commands.
Word 2007: the beginning of macro creation
Now we’ll show you how to make a macro in Word 2007. The process is slightly different from what is presented for later versions of this text editor.
First of all, you need to activate the developer tab:
- Click on the Microsoft Office button (round, with the company logo).
- Select Word Options.
- In the "Basic Settings ...", make the item "Show" Developer "on the ribbon" active.
Now we proceed directly to the creation of a set of commands:
- Go to the "Developer" tab that appears. In Code, select Macro Record.
- In the "Name ..." enter a name. Be careful: if it matches the name of the standard macro, the new entry will replace it. Therefore, to check in the "Macros" group of the "Code" group, find the "Word Commands" and make sure that the invented name does not match those present there.
- In "Macro Available ...", select where it can be applied. If for all files, then stop at Normal.dotm.
- Enter a description.
Word 2007: Three Macro Recording Options
Further you can go in three ways.
Record without binding . You write a macro without associating it with either a button or a keyboard shortcut. To do this, just click on OK.
Binding a macro to a button . Here you should go this way:
- Click on the "Button."
- In the "Quick Access Toolbar Settings", select all documents or a separate file where you can apply this macro.
- In the "Choose Commands" window, click on the desired macro. Then - click on "Add".
- To configure, click on "Change."
- In Symbol, select the icon for the button.
- "Display Name" is the name of the macro.
- Double click on OK to start recording.
Binding a macro to a keyboard shortcut . Here is the following path:
- Stop at the Keyboard.
- In the "Commands" find the macro that you are about to record.
- In the New Keyboard Shortcut, enter a combination of your own. Click on "Assign."
- Click Close to start recording.
Further, the path becomes the same for all options:
- Follow the steps to be included in the macro.
- The process can be completed by selecting "Stop recording" in the "Code" tab.
Opening Macro Files
Documents that support macros have the extension .docm. Difficulties with them sometimes arise at the time of launch - a text editor throws an error. Let's see how to open Word with macros:
- Double-click on this document. The system itself will select a program on your PC that can open it.
- If unsuccessful, change the extension to .doc, .docx.
- In case of unsatisfactory result, use the programs:
- Word 2007, recognizing Open XML.
- Word 2010.
- FileViewPro application.
Enable Macros
How to enable macros in Word? There are three options.
When the message bar appears . As soon as you open the file with macros, a yellow window with a shield and a request to enable this set of commands appears on the screen. Only if you are confident in the reliability of the document source, click on the "Include Content" panel.
Using the Backstage View . When opening a macro file, do the following:
- Click on "File".
- In the "Security Alert" click on the "Enable Content" item.
- In this section, make active "Always include ..." This will turn the document into a reliable one.
Inclusion at the time of opening the document . You can make macros active only for a period of work with a specific file. When you close it and start it again, they will have to be turned on again. For this option, the following algorithm:
- Click the tab called "File."
- In the "Security Alert" click on "Enable Content".
- Go to the "Advanced Options".
- In the "Security Settings ..." select "Enable for this session only" for each of the macros available in the document.
- Confirm with OK.
Disabling Macros
Finally, we’ll look at how to remove macros in Word:
- On the File tab, go to Options.
- In the "Control Center ..." select "Center Settings ..."
- Click on Macro Options.
- Choose what you need:
- Disable everything without notification (both macros and danger / safety warnings).
- Disable everything with a notification (only macros are removed, security notifications remain).
- Disable everything except digitally signed macros (only the publisher’s trustworthy macros are displayed - you need to agree to their inclusion in the notification when opening the file).
- Confirm your selection by clicking on OK.
Macro creation has its own peculiarities in various versions of the Word text editor. And when you open a file with this group of commands in this program, you can choose whether to enable or not activate them.