General Switches

Some of the content in this topic may not be applicable to some languages.

General switches are optional instructions that modify the format of or prevent changes to the information that results from a field. You can use the following four general switches with most fields.

Format (\*)

Specifies how to display field results. The following format instructions determine the use of uppercase and lowercase letters; number formats ù for example, whether "9" is displayed as "ix" (roman numerals) or "ninth" (ordinal text) and character formats. Format switches also retain a field result's formatting when the field is updated.

Capitalization formats

The following is a list of switches and items that they capitalize:

\* Caps
The first letter of each word. For example, { FILLIN "Type your name:" \* Caps } displays "Julie Tanner" even if the name is typed in lowercase letters.
\* FirstCap
The first letter of the first word. For example, { COMMENTS \* FirstCap } displays "Weekly report on sales".
\* Upper
All letters. For example, { QUOTE "word" \* Upper } displays "WORD".
\* Lower
None of the result; all letters are lowercase. For example, { FILENAME \* Lower } displays "weekly sales report.doc".

Note   This switch has no effect if the entire field that contains the switch is formatted as small capital letters.

Number formats

The following is a list of number switches and their results:

\*alphabetic
Displays results as alphabetic characters. The result has the same case as the word "alphabetic" in the field code. For example, { SEQ appendix \* ALPHABETIC } displays "B" (instead of "2"), and { SEQ appendix \* alphabetic } displays "b".
\*Arabic
 Displays results as arabic cardinal numerals. For example, { PAGE \* Arabic } displays "31".

Note   If the Number format setting in the Page number format dialog box (Page numbers command, Insert menu) is not arabic, this switch overrides the Number Format setting.

\*CardText
Displays results as cardinal text. The result is formatted in lowercase letters unless you add a format switch to specify a different capitalization. For example, { = SUM(A1:B2) \* CardText } displays "seven hundred ninety", and { = SUM(A1:B2) \* CardText \* Caps } displays "Seven Hundred Ninety".
\*DollarText
Displays results as cardinal text. Microsoft Word inserts "and" at the decimal place and displays the first two decimals (rounded) as arabic numerators over 100. The result is formatted in lowercase letters unless you add a format switch to specify a different capitalization. For example, { = 9.20 + 5.35 \* DollarText \* Upper } displays "FOURTEEN and 55/100".
\*Hex
Displays results as hexadecimal numbers. For example, { QUOTE "458" \* Hex } displays "1CA".
\*OrdText
Displays results as ordinal text. The result is formatted in lowercase letters unless you add a format switch to specify a different capitalization. For example, { DATE \@ "d" \* OrdText } displays "twenty-first", and { DATE \@ "d" \* OrdText \* FirstCap } displays "Twenty-first".
\*Ordinal
Displays results as ordinal arabic text. For example, { DATE \@ "d" \* Ordinal } displays "30th".
\*roman
Displays results as roman numerals. The result has the same case as the word "roman" in the field code. For example, { SEQ CHAPTER \* roman } displays "xi", and { SEQ CHAPTER \* ROMAN } displays "XI".

Character formats and protecting previously applied formats

The following are character formatting switches and their results:

\*Charformat

Applies the formatting of the first letter of the field type to the entire result. The result of the following example has bold formatting because the "R" in "REF" is bold.

{ REF chapter2_title \* Charformat } displays "Whales of the Pacific".

Note   To add this switch, type it in the field code or in the Field Codes box in the Field dialog box (Insert menu, Field command).

\*MERGEFORMAT  
Applies the formatting of the previous result to the new result. For example, if you select the name displayed by the field { AUTHOR \* MERGEFORMAT } and apply bold formatting, Microsoft Word retains the bold formatting when the field is updated when the author name changes.
Note   When you insert fields by using the Field dialog box (Insert menu, Field command), the \*MERGEFORMAT switch is included by default. You can turn this option off by clearing the Preserve formatting during updates check box in the Field dialog box.

Numeric Picture (\#)

Specifies the display of a numeric result. This switch is called a "picture" switch because you use symbols to represent the format of the field result.

For example, the switch \# $#,##0.00 in { = SUM(ABOVE) \# $#,##0.00 } displays a result such as "$4,455.70." If the result of a field is not a number, this switch has no effect.

Note   Quotation marks are not required around simple numeric pictures that do not include spaces ù for example, { MarchSales \# $#,##0.00 }. For more complex numeric pictures and those that include text or spaces, enclose the numeric picture in quotation marks, as shown in the following picture item examples. Microsoft Word adds quotation marks to numeric picture switches if you insert a field by using the Field command (Insert menu) or the Formula command (Table menu).

Combine the following picture items to build a numeric picture switch.

Picture items

0 (zero)
Specifies the requisite numeric places to display in the result. If the result does not include a digit in that place, Word displays a 0 (zero). For example, { = 4 + 5 \# 00.00 } displays "09.00".
#
Specifies the requisite numeric places to display in the result. If the result does not include a digit in that place, Word displays a space. For example, { = 9 + 6 \# $### } displays "$ 15".
x
Drops digits to the left of the "x" placeholder. If the placeholder is to the right of the decimal point, Word rounds the result to that place. For example:
{ = 111053 + 111439 \# x## } displays "492".
{ = 1/8 \# 0.00x } displays "0.125".
{ = 3/4 \# .x } displays ".8".
. (decimal point)
Determines the decimal point position. For example, { = SUM(ABOVE) \# $###.00 } displays "$495.47".

Note   Use the decimal symbol specified as part of the regional settings in Microsoft Windows Control Panel.

, (digit grouping symbol)
Separates a series of three digits. For example, { = NetProfit \# $#,###,### } displays "$2,456,800".

Note   Use the digit grouping symbol specified as part of the regional settings in Windows Control Panel.

- (minus sign)
Adds a minus sign to a negative result, or adds a space if the result is positive or 0 (zero). For example, { = 10 - 90 \# -## } displays "-80".
+ (plus sign)
Adds a plus sign to a positive result, a minus sign to a negative result, or a space if the result is 0 (zero). For example, { = 100 - 90 \# +## } displays "+10", and { = 90 - 100 \# +## } displays "-10".
%, $, *, and so on
Includes the specified character in the result. For example, { = netprofit \# "##%" } displays "33%".
"positive; negative"
Specifies different number formats for positive and negative results. For example, if the bookmark Sales95 is a positive value, the field { Sales95 \# "$#,##0.00;-$#,##0.00" } displays the value with regular formatting ù for example, "$1,245.65". A negative value is displayed with bold formatting and a minus sign ù for example, "-$ 345.56".
"positive; negative; zero"
Specifies different number formats for a positive result, a negative result, and a 0 (zero) result. For example, depending on the value of the Sales95 bookmark, { Sales95 \# "$#,##0.00;($#,##0.00);$0" } displays positive, negative, and 0 (zero) values as follows: $1,245.65, ($ 345.56), $0
'text'
Adds text to the result. Enclose the text in single quotation marks. For example, { = { Price } *8.1% \# "$##0.00 'is sales tax' " } displays "$347.44 is sales tax".
`numbereditem`
Displays the number of the preceding item that you numbered by using the Caption command (Insert menu) or by inserting a SEQ field. Enclose the item identifier, such as "table" or "figure," in grave accents (`). The sequential number is displayed in arabic numerals. For example, { = SUM(A1:D4) \# "##0.00 'is the total of Table' `table`" } displays "456.34 is the total of Table 2".

Date-Time Picture (\@)

Specifies the display of a date or time. This switch is called a "picture" switch because you use symbols to represent the format of the field result.

For example, the switch \@ "dddd, MMMM d, yyyy" in the field { DATE \@ "dddd, MMMM d, yyyy" } displays "Friday, November 24, 2000." Combine the following date and time instructions ù day (d), month (M), and year (y); hours (h) and minutes (m) ù to build a date-time picture. You can also include text, punctuation, and spaces.

Date instructions

Month (M)

The letter "M" must be uppercase to distinguish months from minutes.

Picture items

M
Displays the month as a number without a leading 0 (zero) for single-digit months. For example, July is "7".
MM
Displays the month as a number with a leading 0 (zero) for single-digit months. For example, July is "07".
MMM
Displays the month as a three-letter abbreviation. For example, July is "Jul".
MMMM
Displays the month as its full name.

Day (d)

Displays the day of the month or the day of the week. The letter "d" can be either uppercase or lowercase.

Picture items

d
Displays the day of the week or month as a number without a leading 0 (zero) for single-digit days. For example, the sixth day of the month is displayed as "6".
dd
Displays the day of the week or month as a number with a leading 0 (zero) for single-digit days. For example, the sixth day of the month is displayed as "06".
ddd
Displays the day of the week or month as a three-letter abbreviation. For example, Tuesday is displayed as "Tue".
dddd
Displays the day of the week as its full name.

Year (y)

Displays the year as two or four digits. The letter "y" can be either uppercase or lowercase.

Picture items

yy
Displays the year as two digits with a leading 0 (zero) for years 01 through 09. For example, 1995 is displayed as "95", and 2006 is displayed as "06".
yyyy
Displays the year as four digits.

Time instructions

Hours (h)

A lowercase "h" bases time on the 12-hour clock. An uppercase "H" bases time on the 24-hour, or military, clock; for example, 5 P.M. is displayed as "17".

Picture items

h or H
Displays the hour without a leading 0 (zero) for single-digit hours. For example, the hour of 9 A.M. is displayed as "9".
hh or HH
Displays the hour with a leading 0 (zero) for single-digit hours. For example, the hour of 9 A.M. is displayed as "09".

Minutes (m)

The letter "m" must be lowercase to distinguish minutes from months.

Picture items

m
Displays minutes without a leading 0 (zero) for single-digit minutes. For example, { TIME \@ "m" } displays "2".
mm
Displays minutes with a leading 0 (zero) for single-digit minutes. For example, { TIME \@ "mm" } displays "02".

AM/PM and other text and punctuation

Displays A.M. and P.M. in one of four formats. To change the A.M. and P.M. symbols for Microsoft Windows, change the regional settings in Windows Control Panel.

Picture items for A.M. and P.M. display

AM/PM
Displays A.M. and P.M. as uppercase. For example, { TIME \@ "h AM/PM" } displays "9 AM" or "5 PM".
am/pm
Displays A.M. and P.M. as lowercase. For example, { TIME \@ "h am/pm" } displays "9 am" or "5 pm".
A/P
Displays A.M. and P.M. as abbreviated uppercase. For example, { TIME \@ "h A/P" } displays "9 A" or "5 P".
a/p
Displays A.M. and P.M. as abbreviated lowercase. For example, { DATE \@ "h a/p" } displays "9 a" or "5 p".

Picture items for other text display

'text'
Any specified text in a date or time. Enclose the text in single quotation marks. For example, { TIME \@ "HH:mm 'Greenwich mean time' " } displays "12:45 Greenwich mean time".
character
Includes the specified character in a date or time, such as a : (colon), - (hyphen), * (asterisk), or space. For example, { DATE \@ "HH:mm MMM-d, 'yy" } displays "11:15 Nov-6, '95".
`numbereditem`
Includes in a date or time the number of the preceding item that you numbered by using the Caption command on the Insert menu, or by inserting a SEQ field. Enclose the item identifier, such as "table" or "figure," in grave accents (`). Microsoft Word displays the sequential number in arabic numerals. For example, { PRINTDATE \@ "'Table' `table` 'was printed on' M/d/yy" } displays "Table 2 was printed on 9/25/95".

Note   Quotation marks are not required around simple date-time pictures that do not include spaces or text ù for example, { DATE \@ MM/yy }. For more complex date-time pictures and those that include spaces or text, enclose the entire date-time picture in quotation marks, for example, { DATE \ @ "dddd MMMM d, yyyy', at' h:mm" }. Microsoft Word adds quotation marks to date-time picture switches if you insert a field by using the Date And Time command or the Field command (Insert menu).

Lock Result (\!)

Prevents a field that is included in the result of a BOOKMARK, INCLUDETEXT, or REF field from being updated unless the field result in the original location has changed. Without this switch, Microsoft Word updates fields included in a field result whenever the BOOKMARK, INCLUDETEXT, or REF field is updated.

For example, the field { INCLUDETEXT C:\\Sales\Qtr4 Sales.doc \! } inserts the contents of the document "Qtr4 Sales.doc," which contains a DATE field and an EMBED field. If you update the INCLUDETEXT field, the "\!" switch prevents Word from updating the DATE and EMBED fields in the included text unless they are first updated in the original document ("Qtr4 Sales.doc"). The switch ensures that the text inserted by the INCLUDETEXT field matches the text in the original document. To update the DATE and EMBED fields in both locations, update fields in the original document ("Qtr4 Sales.doc"), and then update the INCLUDETEXT field.

Note   You cannot use general switches with the following fields:

AUTONUM

AUTONUMLGL

AUTONUMOUT

EMBED

FORMTEXT

TA (Table of Authorities)

TC (Table of Contents Entry)

XE (Index Entry)

EQ (Equation)  

GOTOBUTTON

MACROBUTTON

RD

FORMCHECKBOX

FORMDROPDOWN

LISTNUM