How to apply a button to run a macro code in Word document?
Sometimes, you may want to apply a button to run a specific macro code in a Word document, but, how could you solve this task in Word file?
The following steps can help you to deal with this job in Word document, please do as this:
1. Click where you want to use a button, and then press Ctrl +F9 key to insert a pair of braces, and then type the below text between the braces, see screenshot:
MACROBUTTON MacroName Double-Click To Run Macro
Note: MacroName is the code name in your Word file that you want to run when clicking the button, please change it to your need.
2. Then, right click the field code, and select Toggle Field Codes from the context menu, see screenshot:
3. And then, you can format the field text with border and shading for making it as a button. Please select the field text, and then choose Borders and Shading from the Borders drop down list under the Home tab, see screenshot:
4. In the Borders and Shading dialog box, specify the border style and shading color as you need. See screenshot:
5. Then, click OK, and the field text has been formatted as a button, now when double clicking this button, your specific macro code will be triggered at once, see screenshot:
Recommended Productivity Tools
- Complicated and repeated operations can be done a one-time processing in seconds.
- Insert multiple images across folders into Word document at once.
- Merge and combine multiple Word files across folders in to one with your desired order.
- Split the current document into separate documents according to heading 1, section break or other criteria.
- Convert files between Doc and Docx, Docx and PDF, collection of tools for common conversions and selection, and so on...