[Table of Contents] [docx version]
WordprocessingML Reference Material - Table of Contents
general-formatting-switch:
\* [ " ] switch-argument [ " ]
A general-formatting-switch specifies a variety of formats for a numeric or text result. If the result type of a field does not correspond to the format specified, this switch has no effect.
Quotation marks are required around switch-argument if it contains white space; otherwise, they are optional.
A switch-argument is made up of a series of picture items.
General Formatting Switch Arguments | |
Switch Argument |
Description |
AIUEO |
Formats a numeric result using hiragana characters in the traditional a-i-u-e-o order. [Example: 1 \* AIUEO results in ア. end example] Corresponds to an ST_NumberFormat enumeration value of aiueo. |
ALPHABETIC |
Formats a numeric result as one or more occurrences of an uppercase alphabetic Latin character. Value 1 results in the letter A, value 2 results in the letter B, and so on up to value 26, which results in the letter Z. For values greater than 26, 26 is repeatedly subtracted from the value until the result is 26 or less. The result value determines which letter to use, and the same letter is repeated for each time 26 was subtracted from the original value. [Example: =54 \* ALPHABETIC results in "BBB" as subtracting 26 from 54 two times, results in the value 2, which is represented by the letter B. end example] |
alphabetic |
Formats a numeric result as one or more occurrences of an lowercase alphabetic Latin character. Value 1 results in the letter a, value 2 results in the letter b, and so on up to value 26, which results in the letter z. For values greater than 26, 26 is repeatedly subtracted from the value until the result is 26 or less. The result value determines which letter to use, and the same letter is repeated for each time 26 was subtracted from the original value. [Example: =52 \* alphabetic results in "zz" as subtracting 26 from 52 one time, results in the value 26, which is represented by the letter z.. end example] |
Arabic |
Formats a numeric result using Arabic cardinal numerals. [Example: For page 123, PAGE \* Arabic results in "123". end example] Corresponds to an ST_NumberFormat enumeration value of decimal. |
ARABICABJAD |
Formats a numeric result using ascending Abjad numerals. [Example: 12 \* ARABICABJAD results in ل. end example] Corresponds to an ST_NumberFormat enumeration value of arabicAbjad. |
ARABICALPHA |
Formats a numeric result using characters in the Arabic alphabet. [Example: 12 \* ARABICABJAD results in س. end example] Corresponds to an ST_NumberFormat enumeration value of arabicAlpha. |
ArabicDash |
Formats a numeric result using Arabic cardinal numerals, with a prefix of "- " and a suffix of " -". [Example: For page 123, PAGE \* ArabicDash results in "- 123 -". end example] Corresponds to an ST_NumberFormat enumeration value of numberInDash. |
BAHTTEXT |
Formats a numeric result using the given Thai style. [Example: 1 \* BAHTTEXT results in หนึ่งบาทถ้วน. end example] |
Caps |
Capitalizes the first letter of each word. [Example: USERNAME "mary smith" \* Caps results in "Mary Smith", whereas USERNAME "marysmith" \* Caps results in "Marysmith". end example] |
CardText |
Formats a numeric result as lowercase cardinal text. [Example: For page 123, PAGE \* CardText results in "one hundred twenty-three". end example] Corresponds to an ST_NumberFormat enumeration value of cardinalText. |
CHARFORMAT |
See the discussion following this table. |
CHINESENUM1 |
Formats a numeric result using ascending numbers from the Chinese counting system. [Example: 10 \* CHINESENUM1 results in 十. end example] Corresponds to an ST_NumberFormat enumeration value of chineseCounting. |
CHINESENUM2 |
Formats a numeric result using sequential numbers from the Chinese simplified legal format. [Example: 123 \* CHINESENUM2 results in 壹佰贰拾叁. end example] Corresponds to an ST_NumberFormat enumeration value of chineseLegalSimplified. |
CHINESENUM3 |
Formats a numeric result using sequential numbers from the Chinese counting thousand system. [Example: 10 \* CHINESENUM3 results in 一百二十三. end example] Corresponds to an ST_NumberFormat enumeration value of chineseCountingThousand. |
CHOSUNG |
Formats a numeric result using sequential numbers from the Korean Chosung format. [Example: 1 \* CHOSUNG results in ㄱ. end example] Corresponds to an ST_NumberFormat enumeration value of chosung. |
CIRCLENUM |
Formats a numeric result using decimal numbering enclosed in a circle, using the enclosed alphanumeric glyph character for numbers in the range 1–20. For non-negative numbers outside this range, formats them as with ARABIC. [Example: 12 \* CIRCLENUM results in ⑫. end example] Corresponds to an ST_NumberFormat enumeration value of decimalEnclosedCircle. |
DBCHAR |
Formats a numeric result using double-byte Arabic numbering. [Example: 123 \* DBCHAR results in 123. end example] Corresponds to an ST_NumberFormat enumeration value of decimalFullWidth. |
DBNUM1 |
Formats a numeric result using sequential digital ideographs, using the appropriate character. [Example: 12 \* DBNUM1 results in 一二. end example] Corresponds to an ST_NumberFormat enumeration value of ideographDigital. |
DBNUM2 |
Formats a numeric result using sequential numbers from the Korean counting system. [Example: 12 \* DBNUM2 results in 십이. end example] Corresponds to an ST_NumberFormat enumeration value of koreanCounting. |
DBNUM3 |
Formats a numeric result using sequential numbers from the Japanese legal counting system. [Example: 12 \* DBNUM3 results in 壱拾弐. end example] Corresponds to an ST_NumberFormat enumeration value of japaneseLegal. |
DBNUM4 |
Formats a numeric result using sequential numbers from the Japanese digital ten thousand counting system. [Example: 12 \* DBNUM4 results in 一二. end example] Corresponds to an ST_NumberFormat enumeration value of japaneseDigitalTenThousand. |
DollarText |
Formats a numeric result in the following form: integer-part-as-cardinal-text and nn/100 The fractional part is rounded to two decimal places, nn, and is formatted using Arabic cardinal numerals. [Example: =1234.567 \* DollarText results in "one thousand two hundred thirty-four and 57/100". end example] |
FirstCap |
Capitalizes the first letter of the first word. [Example: USERNAME "mary smith" \* FirstCap results in "Mary smith". end example] |
GANADA |
Formats a numeric result using sequential numbers from the Korean Ganada format. [Example: 12 \* GANADA results in 타. end example] Corresponds to an ST_NumberFormat enumeration value of ganada. |
GB1 |
Formats a numeric result using decimal numbering followed by a period, using the enclosed alphanumeric glyph character. [Example: 12 \* GB1 results in ⒓. end example] Corresponds to an ST_NumberFormat enumeration value of decimalEnclosedFullstop. |
GB2 |
Formats a numeric result using decimal numbering enclosed in parenthesis, using the enclosed alphanumeric glyph character. [Example: 12 \* GB2 results in ⑿. end example] Corresponds to an ST_NumberFormat enumeration value of decimalEnclosedParen. |
GB3 |
Formats a numeric result using decimal numbering enclosed in a circle, using the enclosed alphanumeric glyph character. Once the specified sequence reaches 11, the numbers may be replaced with non-enclosed equivalents. [Example: 12 \* GB3 results in 12. end example] Corresponds to an ST_NumberFormat enumeration value of decimalEnclosedCircleChinese. |
GB4 |
Formats a numeric result using decimal numbering enclosed in a circle, using the enclosed alphanumeric glyph character. Once the specified sequence reaches 11, the numbers may be replaced with non-enclosed equivalents. [Example: 12 \* GB4 results in 12. end example] Corresponds to an ST_NumberFormat enumeration value of ideographEnclosedCircle. |
HEBREW1 |
Formats a numeric result using Hebrew numerals. [Example: 123 \* HEBREW1 results in קכג. end example] Corresponds to an ST_NumberFormat enumeration value of hebrew1. |
HEBREW2 |
Formats a numeric result using the Hebrew alphabet. [Example: 123 \* HEBREW2 results in תתתתתמ. end example] Corresponds to an ST_NumberFormat enumeration value of hebrew2. |
Hex |
Formats the numeric result using uppercase hexadecimal digits. [Example: For page 355, PAGE \* Hex results in "FF". end example] Corresponds to an ST_NumberFormat enumeration value of hex. |
HINDIARABIC |
Formats a numeric result using Hindi numbers. [Example: 123 \* HINDIARABIC results in १२३. end example] Corresponds to an ST_NumberFormat enumeration value of hindiNumbers. |
HINDICARDTEXT |
Formats a numeric result using sequential numbers from the Hindi counting system. [Example: 123 \* HINDICARDTEXT results in एक सौ तेईस. end example] Corresponds to an ST_NumberFormat enumeration value of hindiCounting. |
HINDILETTER1 |
Formats a numeric result using Hindi vowels. [Example: 123 \* HINDILETTER1 results in ठठठठ. end example] Corresponds to an ST_NumberFormat enumeration value of hindiVowels. |
HINDILETTER2 |
Formats a numeric result using Hindi consonants. [Example: 123 \* HINDILETTER2 results in ओओओओओओओ. end example] Corresponds to an ST_NumberFormat enumeration value of hindiConsonants. |
IROHA |
Formats a numeric result using the Japanese iroha. [Example: 12 \* IROHA results in オ. end example] Corresponds to an ST_NumberFormat enumeration value of iroha. |
KANJINUM1 |
Formats a numeric result using a Japanese style using sequential digital ideographs, using the appropriate character. [Example: 12 \* KANJINUM1 results in 一二. end example] |
KANJINUM2 |
Formats a numeric result using the Japanese counting system. [Example: 12 \* KANJINUM2 results in 十二. end example] Corresponds to an ST_NumberFormat enumeration value of japaneseCounting. |
KANJINUM3 |
Formats a numeric result using the Japanese legal counting system. [Example: 12 \* KANJINUM3 results in 壱拾弐. end example] |
Lower |
All letters are lowercase. [Example: USERNAME "Mary Smith" \* Lower results in "mary smith". end example] |
MERGEFORMAT |
See the discussion following this table. |
Ordinal |
Formats a numeric result using lowercase ordinal Arabic numerals. [Example: =32 \* Ordinal results in "32nd". end example] Corresponds to an ST_NumberFormat enumeration value of ordinal. |
OrdText |
Formats a numeric result as lowercase ordinal text. Apart from being used to round off the whole number part, the fractional part is not used. [Example: =1234.567 \* OrdText results in "one thousand two hundred thirty-fifth". end example] Corresponds to an ST_NumberFormat enumeration value of ordinalText. |
Roman |
Formats a numeric result using uppercase Roman numerals. [Example: For page 123, PAGE \* Roman results in "CXXIII". end example] Corresponds to an ST_NumberFormat enumeration value of upperRoman. |
roman |
Formats a numeric result using lowercase Roman numerals. [Example: For page 123, PAGE \* roman results in "cxxiii". end example] Corresponds to an ST_NumberFormat enumeration value of lowerRoman. |
SBCHAR |
Formats a numeric result using single-byte Arabic numbering. [Example: 123 \* SBCHAR results in 123. end example] Corresponds to an ST_NumberFormat enumeration value of decimalHalfWidth. |
THAIARABIC |
Formats a numeric result using Thai numbers. [Example: 123 \* THAIARABIC results in ๑๒๓. end example] Corresponds to an ST_NumberFormat enumeration value of thaiNumbers. |
THAICARDTEXT |
Formats a numeric result using sequential numbers from the Thai counting system. [Example: 123 \* THAICARDTEXT results in หนึ่งร้อยยี่สิบสาม. end example] Corresponds to an ST_NumberFormat enumeration value of thaiCounting. |
THAILETTER |
Formats a numeric result using Thai letters. [Example: 123 \* THAILETTER results in ฮฮฮ. end example] Corresponds to an ST_NumberFormat enumeration value of thaiLetters. |
Upper |
All letters are uppercase. [Example: USERNAME "Mary Smith" \* Upper results in "MARY SMITH". end example] |
VIETCARDTEXT |
Formats a numeric result using Vietnamese numerals. [Example: 12 \* VIETCARDTEXT results in imườ hai. end example] Corresponds to an ST_NumberFormat enumeration value of vietnameseCounting. |
ZODIAC1 |
Formats a numeric result using sequential numerical traditional ideographs. [Example: 1 \* ZODIAC1 results in 甲. end example] Corresponds to an ST_NumberFormat enumeration value of ideographTraditional. |
ZODIAC2 |
Formats a numeric result using sequential zodiac ideographs. [Example: 1 \* ZODIAC2 results in 子. end example] Corresponds to an ST_NumberFormat enumeration value of ideographZodiac. |
ZODIAC3 |
Formats a numeric result using sequential traditional zodiac ideographs. [Example: 1 \* ZODIAC3 results in 甲子. end example] Corresponds to an ST_NumberFormat enumeration value of ideographZodiacTraditional. |
The general formatting switch argument CHARFORMAT is used to set the visual appearance of a field's value by setting the first run in that field's field-type name to the desired state using any of the elements that can be directly nested inside the run property element, rPr. [Example: In a US-English context, on January 4, 2006, the field DATE \* CHARFORMAT results in "1/4/2006". However, if the D in DATE is made bold, the field DATE \* CHARFORMAT results in "1/4/2006". If that D is made italic, the field DATE \* CHARFORMAT results in "1/4/2006". If that D is made bold, underlined, and red, the field DATE \* CHARFORMAT results in "1/4/2006".
The XML for the bold, underlined, red case is as follows:
<w:r>
<w:fldChar w:fldCharType="begin"/>
</w:r>
<w:r>
<w:instrText xml:space="preserve"> </w:instrText>
</w:r>
<w:r …>
<w:rPr>
<w:b/>
<w:color w:val="ED1C24"/>
<w:u w:val="single"/>
</w:rPr>
<w:instrText>D</w:instrText>
</w:r>
<w:r>
<w:instrText xml:space="preserve">ATE </w:instrText>
</w:r>
<w:r>
<w:fldChar w:fldCharType="separate"/>
</w:r>
<w:r …>
<w:rPr>
<w:b/>
<w:color w:val="ED1C24"/>
<w:u w:val="single"/>
</w:rPr>
<w:t>1/4/2006</w:t>
</w:r>
<w:r>
<w:fldChar w:fldCharType="end"/>
</w:r>
end example]
If a format specified directly in the first run of a field's field-type name conflicts with a general formatting switch, the general formatting switch is ignored. [Example: If the first run is set in small caps and the switch \* Lower is also used, that switch is ignored. end example]
The general formatting switch argument MERGEFORMAT is used to apply formatting directly to part of a result such that when that result is updated, the formatting is preserved. The formatting is expressed in XML using an rPr element on the run that contains the most recently updated field result. [Example: Consider the following field:
TIME \@ "HH:mm:ss" \* MERGEFORMAT
When it is updated, the result might be 12:22:27, for example. If the seconds part of the displayed field result is underlined, as in 12:22:27, when that field is next updated, the seconds underlining is preserved. If MERGEFORMAT is omitted, the rPr element on the run that contains the most recently updated field result is ignored.
The XML generated for this is:
<w:r>
<w:fldChar w:fldCharType="begin"/>
</w:r>
<w:r>
<w:instrText xml:space="preserve"> TIME \@ "HH:mm:ss" \* MERGEFORMAT </w:instrText>
</w:r>
<w:r>
<w:fldChar w:fldCharType="separate"/>
</w:r>
<w:r …>
<w:t>17:02:</w:t>
</w:r>
<w:r …>
<w:rPr>
<w:u w:val="single"/>
</w:rPr>
<w:t>32</w:t>
</w:r>
<w:r>
<w:fldChar w:fldCharType="end"/>
</w:r>
end example]