Field codes: AutoTextList field

The AutoTextList field code creates a shortcut menu based on AutoText (AutoText: A storage location for text or graphics you want to use again, such as a standard contract clause or a long distribution list. Each selection of text or graphics is recorded as an AutoText entry and is assigned a unique name.) entries in the active template. The list can vary based on the style that is applied to the AutoText entries when they are created.

Syntax

When you view the AutoTextList field code in your document, the syntax looks like this:

{ AUTOTEXTLIST "Literal text" \s ["Style name"] \t ["Tip text"] }

 Note   A field code tells the field what to show. Field results are what is shown in the document after having evaluated the field code. To toggle between viewing the field code and the field code results, press Alt+F9.

Instructions

"Literal text"

Text that displays in the document before the user displays the shortcut menu. If the text contains spaces, enclose it in quotation marks.

"Style name"

The name of the style of the AutoText entries that you want to appear in the list. The style can be a paragraph style (paragraph style: A combination of character- and paragraph-formatting characteristics that are named and stored as a set. You can select a paragraph and use the style to apply all of the formatting characteristics to the paragraph at one time.) or a character style (character style: A combination of any of the character formatting options identified by a style name.). If the style name contains spaces, enclose it in quotation marks.

"Tip text"

Text that displays in the ScreenTip (ScreenTip: A short description that appears when the user holds the mouse pointer over an object, such as a button or hyperlink.) when the mouse pointer hovers over the field result (field results: Text or graphics inserted in a document when Microsoft Word carries out a field's instructions. When you print the document or hide field codes, the field results replace the field codes.). Enclose the text in quotation marks.

Switches

\s

Specifies that the list will contain entries based on a specific style. Without this switch, AutoText entries of the current paragraph style (paragraph style: A combination of character- and paragraph-formatting characteristics that are named and stored as a set. You can select a paragraph and use the style to apply all of the formatting characteristics to the paragraph at one time.) appear. If there are no entries for the current style, all AutoText entries appear.

\t

Specifies unique text to show in the ScreenTip (ScreenTip: A short description that appears when the user holds the mouse pointer over an object, such as a button or hyperlink.) instead of the default tip.

Example

If you have created AutoText entries that have the Salutation style applied to them, you can add the following AutoTextList field code:

{ AUTOTEXTLIST "List of salutations" \s Salutation \t "Choose a salutation" } displays the following:

  • In the document: Salutation list
  • In the ScreenTip: Choose a salutation
  • On the shortcut menu: the list of AutoText entries whose style is Salutation.
 
 
Applies to:
Word 2013, Word 2010