microsoft-word-logo

How to Assign a Macro to a Button in a Word Document

word logo-newI 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:

  1. Position your cursor where you would like the MacroButton to appear.
  2. Click CTRL + F9 to insert a field.
  3. Between the field brackets, key in the field name MacroButton and a space).

word macro button

  1. Key in the name of the command or macro you want the button to executed.
  2. 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.
  3. Key in the button name text you want displayed or inspect a graphic to be used.
  4. Click F9 to update the field display.

updated word field

 

1 thought on “How to Assign a Macro to a Button in a Word Document”

  1. Carol I love your tips ­čÖé You make me look like a genius at work every time I use one of your tips. I need to just have a folder for all these. Keep these coming!

Comments are closed.

Scroll to Top

WHY NOT SUBSCRIBE TO OUR NEWSLETTER?

Get great content like this delivered to your inbox!

It's free, convenient, and delivered right to your inbox! We do not spam and we will not share your address. Period!