General formatting

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 
.]

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.

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..

Arabic

Formats a numeric result using Arabic cardinal numerals.
example: : For page 123, PAGE \* Arabic results in "123".

Corresponds to an ST_NumberFormat enumeration value of decimal.

ARABICABJAD

Formats a numeric result using ascending Abjad numerals.
example: : 12 \* ARABICABJAD results in 
.]

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 
.]

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 -".

Corresponds to an ST_NumberFormat enumeration value of numberInDash.

BAHTTEXT

Formats a numeric result using the given Thai style.
example: : 1 \* BAHTTEXT results in
.]

Caps

Capitalizes the first letter of each word.
example: : USERNAME "mary smith" \* Caps results in " ", whereasUSERNAME "marysmith" \* Caps results in "Marysmith".

CardText

Formats a numeric result as lowercase cardinal text.
example: : For page 123, PAGE \* CardText results in "one hundred twenty-three".

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
.]

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
.]

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
.]

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
.]

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 
.]

Corresponds to an ST_NumberFormat enumeration value of decimalEnclosedCircle.

DBCHAR

Formats a numeric result using double-byte Arabic numbering.
example: : 123 \* DBCHAR results in
.]

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
.]

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
.]

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
.]

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
.]

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".

FirstCap

Capitalizes the first letter of the first word.
example: : USERNAME "mary smith" \* FirstCap results in "Mary smith".

GANADA

Formats a numeric result using sequential numbers from the Korean Ganada format.
example: : 12 \* GANADA results in
.]

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
.]

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
.]

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
.]

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
.]

Corresponds to an ST_NumberFormat enumeration value of ideographEnclosedCircle.

HEBREW1

Formats a numeric result using Hebrew numerals.
example: : 123 \* HEBREW1 results in
.]

Corresponds to an ST_NumberFormat enumeration value of hebrew1.

HEBREW2

Formats a numeric result using the Hebrew alphabet.
example: : 123 \* HEBREW2 results in
.]

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".

Corresponds to an ST_NumberFormat enumeration value of hex.

HINDIARABIC

Formats a numeric result using Hindi numbers.
example: : 123 \* HINDIARABIC results in
.]

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
.]

Corresponds to an ST_NumberFormat enumeration value of hindiCounting.

HINDILETTER1

Formats a numeric result using Hindi vowels.
example: : 123 \* HINDILETTER1 results in
.]

Corresponds to an ST_NumberFormat enumeration value of hindiVowels.

HINDILETTER2

Formats a numeric result using Hindi consonants.
example: : 123 \* HINDILETTER2 results in
.]

Corresponds to an ST_NumberFormat enumeration value of hindiConsonants.

IROHA

Formats a numeric result using the Japanese iroha.
example: : 12 \* IROHA results in 
.]

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
.]

KANJINUM2

Formats a numeric result using the Japanese counting system.
example: : 12 \* KANJINUM2 results in
.]

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
.]

Lower

All letters are lowercase.
example: : USERNAME "Mary Smith" \* Lower results in "mary smith".

MERGEFORMAT

See the discussion following this table.

Ordinal

Formats a numeric result using lowercase ordinal Arabic numerals.
example: : =32 \* Ordinal results in "32nd".

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".

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".

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".

Corresponds to an ST_NumberFormat enumeration value of lowerRoman.

SBCHAR

Formats a numeric result using single-byte Arabic numbering.
example: : 123 \* SBCHAR results in
.]

Corresponds to an ST_NumberFormat enumeration value of decimalHalfWidth.

THAIARABIC

Formats a numeric result using Thai numbers.
example: : 123 \* THAIARABIC results in
.]

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
.]

Corresponds to an ST_NumberFormat enumeration value of thaiCounting.

THAILETTER

Formats a numeric result using Thai letters.
example: : 123 \* THAILETTER results in
.]

Corresponds to an ST_NumberFormat enumeration value of thaiLetters.

Upper

All letters are uppercase.
example: : USERNAME "Mary Smith" \* Upper results in " ".

VIETCARDTEXT

Formats a numeric result using Vietnamese numerals.
example: : 12 \* VIETCARDTEXT results in
.]

Corresponds to an ST_NumberFormat enumeration value of vietnameseCounting.

ZODIAC1

Formats a numeric result using sequential numerical traditional ideographs.
example: : 1 \* ZODIAC1 results in 
.]

Corresponds to an ST_NumberFormat enumeration value of ideographTraditional.

ZODIAC2

Formats a numeric result using sequential zodiac ideographs.
example: : 1 \* ZODIAC2 results in 
.]

Corresponds to an ST_NumberFormat enumeration value of ideographZodiac.

ZODIAC3

Formats a numeric result using sequential traditional zodiac ideographs.
example: : 1 \* ZODIAC3 results in 
.]

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>
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.
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>