I will go out on a limb here and assume that you are already aware that you can only assign a macro to a button on your QAT (Quick Access Toolbar).
But did you know that Word will also allow you to add buttons within the text in your documents?
Well glory be! You certainly can and what’s more they often save time and keystrokes for you. What a great combination huh?
These macro buttons have a macro or a Word command associated with them and you get to control what happens when the button is selected in your text. This all happens through the use of field codes.
These macro “buttons” are not actually buttons as there is no use of graphics at all although, if you chose, you could create your own graphic and embed it into your field.
The field code syntax is MacroName (the name of the macro or command you want to run, and Display is the text you would want displayed by your field code.
Should you use a graphic rather than text, then your graphic is displayed. Then, when someone double-clicks on the displayed text or graphic, then the macro or command defined by your MacroName will be executed.
Follow the steps below to learn how to assign a command or macro to a button and insert it into your text:
Place your cursor where you would like your macro button to appear.
- Click CTRL + F9 to insert a field. Do not manually use brackets from your keyboard. This will not work.
- Between your field brackets, key in the field name MacroButton and a space.
- Key in the name of the command or macro you would like your button to execute. To find the correct macro or command names you can simply right-click on a blank area of your Ribbon and then click on Customize Quick Access Toolbar. You will find the names in the dialog box.
- Key in the button name you would like displayed, or insert a graphic if you so choose.
- Click F9 to update your field display.
You should now see your macro button in your document.
Law offices often use macro buttons in their documents as do insurance companies and schools.
Suppose you have a document or several different documents and each document has its own particular boilerplate language. In those documents, there are different variables that have to be added (i.e., name, address, gender, etc.). So instead of having to search those documents to know where to plug in your variables, you simply create a macro button so that it will be readily visible and you will know where to put your variables quickly and easily.
- The syntax would be: MacroButton Nomacro Client Name.
- So you would click CTRL + F9 to insert your braces.
- Then in between the braces you would key in the above syntax.
- Then simply click F9 so that you will see your field.
It should look like this:
I know you will use this knowledge of fields and macro buttons to make your life a lot easier. Saving time and keystrokes is just an added bonus!