Search all of Office.com
 
Support / Word / Word 2003 Help and How-to / Automating Tasks and Programmability / Field Types and Switches / Field Reference / Field Code - K-M
 
 

Field codes: MacroButton field

Applies to: Microsoft Office Word 2007, Word 2003

 

{ MACROBUTTON MacroName DisplayText }

Inserts a macro (macro: An action or a set of actions that you can use to automate tasks. Macros are recorded in the Visual Basic for Applications programming language.) 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

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.