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?
Apply a button to run a specific macro code in Word document
Apply a button to run a specific macro code in Word document
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 copy the below text between the braces: 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 the actual macro name.
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:
Best Office Productivity Tools
Kutools for Word - Elevate Your Word Experience with Over 100 Remarkable Features!
๐ค Kutools AI Features: AI Assistant / Real-Time Assistant / Super Polish (Preserve Format) / Super Translate (Preserve Format) / AI Redaction / AI Proofread...
๐ Document Mastery: Split Pages / Merge Documents / Export Selection in Various Formats (PDF/TXT/DOC/HTML...) / Batch Convert to PDF...
โ Contents Editing: Batch Find and Replace across Multiple Files / Resize All Pictures / Transpose Table Rows and Columns / Convert Table to Text...
๐งน Effortless Clean: Sweap away Extra Spaces / Section Breaks / Text Boxes / Hyperlinks / For more removing tools, head to the Remove group...
โ Creative Inserts: Insert Thousand Separators / Check Boxes / Radio Buttons / QR Code / Barcode / Multiple Pictures / Discover more in the Insert group...
๐ Precision Selections: Pinpoint Specific Pages / Tables / Shapes / Heading Paragraphs / Enhance navigation with more Select features...
โญ Star Enhancements: Navigate to Any Location / Auto-Insert Repetitive Text / Toggle Between Document Windows / 11 Conversion Tools...
๐ Supports 40+ Languages: Use Kutools in your preferred language โ supports English, Spanish, German, French, Chinese, and 40+ others!

โจ Kutools for Office โ One Installation, Five Powerful Tools!
Includes Office Tab Pro ยท Kutools for Excel ยท Kutools for Outlook ยท Kutools for Word ยท Kutools for PowerPoint
๐ฆ Get all 5 tools in one suite | ๐ Seamless integration with Microsoft Office | โก Save time and boost productivity instantly
Best Office Productivity Tools
Kutools for Word - 100+ Tools for Word
- ๐ค Kutools AI Features: AI Assistant / Real-Time Assistant / Super Polish / Super Translate / AI Redaction / AI Proofread
- ๐ Document Mastery: Split Pages / Merge Documents / Batch Convert to PDF
- โ Contents Editing: Batch Find and Replace / Resize All Pictures
- ๐งน Effortless Clean: Remove Extra Spaces / Remove Section Breaks
- โ Creative Inserts: Insert Thousand Separators / Insert Check Boxes / Create QR Codes
- ๐ Supports 40+ Languages: Kutools speaks your language โ 40+ languages supported!