MS Office Word: create macro
In MS Office Word, too, you can quickly complete tedious routine tasks by creating a macro for such tasks. Such macros summarize complex sequences of commands and run them automatically. This practical tip describes how you can make your work easier without programming knowledge.
Have complex command sequences processed by macro
Macros are generally created in the Office's own programming language VBA (Visual Basic for Applications). However, you do not need to program yourself, but can while you execute the commands, record them and have them saved in a macro. To do this, proceed as follows.
- Call up the "Macros" command group on the "View" tab. Clicking on the arrow head opens a command list on which you can scroll to "Record Macro". Use the left mouse button to open the corresponding dialog window.
- Alternatively, you can open this window using the "Record macro" icon (table with button) in the status bar. If you do not find the symbol there, you must first add it via "Adjust status line". To do this, right-click in the status bar.
- In the "Record Macro" dialog box, first assign a macro name and specify the storage location. If you want to use the macro in all Word documents, select "All documents". In the text field "Description" you can store more information about the functions of the macro. Click on "OK" to start macro recording. The symbol in the status line changes to a filled square.
- All commands that you now enter are recorded in the macro. For example, you can enter an image formatting routine. You can end the recording by clicking on the symbol in the status line or under View -> Macros -> End recording.
- You can now start the macro at any time via View -> Macros -> Show Macros -> Execute. So that you do not always have to follow this long click path, the command dialog "Record Macro" offers other ways to start the macro. You can either set a keyboard shortcut for the macro start or add an icon to the quick access bar. To do this, click on the respective symbols in the dialog box.
- Attention: If you define a keyboard shortcut for the macro, the recording starts as soon as you assign the keyboard shortcut to the macro and close the window.
- Once you have created a macro, you can edit it at any time. Under View -> Macros -> Show Macros -> Edit, a window opens with the corresponding VBA code, which you can then add to or change.
This practical tip was created on the basis of MS-Word 2013. Because macros can pose a potential risk to your computer, Word 2013 has a security hurdle in place before macros can run. In the next practical tip, we will show you how to overcome this hurdle.