Field codes: MacroButton field

Microsoft Office Word 2003

MacroName DisplayText }

Inserts a macro command, which you can run by double-clicking the results of a MACROBUTTON field. You can also click in the MACROBUTTON field and then press ALT+SHIFT+F9.

Security  Because macros can contain viruses, be careful about running them. Take the following precautions: run up-to-date antivirus software on your computer; set your macro security level to high; clear the Trust all installed add-ins and templates check box; use digital signatures; maintain a list of trusted publishers.

ShowInstructions

MacroName

The name of the macro to run when you double-click the field result. The macro must be available in the active document template or a global template.

DisplayText

The text or graphic to appear as the "button." You can use a field that results in text or a graphic, such as BOOKMARK or INCLUDEPICTURE. The text or graphic must appear on one line in the field result; otherwise, an error occurs.

ShowExamples

Double-clicking the following field runs the PrintEnvelope macro.

Field:

Double-click { MACROBUTTON PrintEnvelope Print Envelope } to print an envelope for this letter.

Result:

Double-click Print Envelope to print an envelope for this letter.