Run a macro when a user double-clicks a button in the document

Article contributed by Bill Coan

1.

Press Control+F9 to insert a set of Field Code Braces. { }.

Do not simply type the braces; you must use Control + F9.

2.

Type the following between the braces:

MACROBUTTON MyMacroName Double-Click To Run Macro

(Use the name of an actual macro, instead of MyMacroName)

You should end up with something like this:

{ MACROBUTTON MyMacroName Double-Click To Run Macro }

3.

Right-click the area between the braces and select Toggle Field Codes.

4.

If desired, format the macro button to look like a button, using Format Font, Format Paragraph, and Format Borders and Shading. For instance: