I know I have covered assigning a macro to a button on Quick Access Toolbar (QAT), but did you know that you could also add buttons in the text of your document??
These buttons have a macro or Word command assigned to them and you can control what happens when the button is clicked in your text. And this is all because you are using a field code!
We really should not refer to the macro as a “button,” because there is no graphic or icon involved. You can, however, create your own graphic and embed it into your field. That field code syntax would be:
MacroButton MacroName Display
MacroName is the name of the macro or command you would like to urn and Display is the text you would like displayed by the field code. If you use a graphic rather than text, then the graphic is displayed. When you double-click on the displayed text or graphic, then the macro or command defined by MacroName will be executed.
Follow the steps below to learn how to assign a command or macro to a button in your text:
- Position your cursor where you would like the MacroButton to appear.
- Click CTRL + F9 to insert a field.
- Between the field brackets, key in the field name MacroButton and a space).
- Key in the name of the command or macro you want the button to executed.
- To find the correct macro or command names, you can right-click on a blank area of your Ribbon and click on Customize Quick Access Toolbar. You can the names in the dialog box.
- Key in the button name text you want displayed or inspect a graphic to be used.
- Click F9 to update the field display.