| Example: | { SET HighNr 11 }{ = HighNr - { SEQ
RevNrList } } { = HighNr - { SEQ RevNrList } } { = HighNr - { SEQ RevNrList } } |
| Display: | 10 9 8 |
No current version of Word supports the Excel-type numbering. But it can be achieved using SET and IF fields:
| { Quote { Set ABC { = { ABC } + 1 } }{ SET ABC2 { IF { ABC } > 26 "{ IF { = MOD({ ABC }, 26) } = 1 "{ = { ABC2 } + 1 }" "{ ABC2 }" }" "{ ABC2 }" } }{ SET ABC1 { IF ABC1 < 26 "{ = { ABC1 } + 1 }" "1" } }{ If { ABC } < 27 "{ ABC1 \* ALPHABETIC }" "{ ABC2 \* ALPHABETIC }{ ABC1 \* ALPHABETIC }" } } |
More information on how to use fields.
In Word 6/95, this works:
| ITEM 1 | ITEM 2 | ITEM 3 | Standard Formula | RESULT | Field set to generate relative cell reference |
| 3 | 2 | 4 | { = A1 * B1 - C1 } | 2 | { Quote { Set CellNr1 "a{ SEQ CellNr }" }{ Set CellNr2 "b{ SEQ CellNr \c }" }{ Set CellNr3 "c{ SEQ CellNr \c }" }{ = { Ref CellNr1 }*{ Ref CellNr2 }-{ Ref CellNr3 } } } |
| 6 | 2 | 4 | { = A2 * B2 - C2 } | 8 | { Quote { Set CellNr1 "a{ SEQ CellNr }" }{ Set CellNr2 "b{ SEQ CellNr \c }" }{ Set CellNr3 "c{ SEQ CellNr \c }" }{ = { Ref CellNr1 }*{ Ref CellNr2 }-{ Ref CellNr3 } } } |
As in so many things, Word97's fields don't behave quite right. When you try to combine something in the SET bookmark with the SEQ field, the SEQ field increments by 2, instead of by 1, so you need this:
| ITEM 1 | ITEM 2 | ITEM 3 | Standard Formula | RESULT | Field set to generate relative cell reference |
| 3 | 2 | 4 | { = A1 * B1 - C1 } | 2 | { Quote { Set CellNr1 "a{ = { SEQ CellNr }/2}" }{ Set CellNr2 "b{ = { SEQ CellNr \c }/2}" }{ Set CellNr3 "c{ = { SEQ CellNr \c }/2}" }{ = { Ref CellNr1 }*{ Ref CellNr2 }-{ Ref CellNr3 } } } |
| Example: | { QUOTE { = SET n
1999999 }{ IF n < 1000000 "{ = n \*cardtext }" "{ = int(n/1000000) \* cardtext } million
{ SET r { = MOD(n, 1000000) } }{ IF r = 0 ""
"{ = r \* cardtext }" }" } \* caps \* CharFormat }
| Display: | one million nine
hundred ninety-nine thousand nine hundred ninety-nine |
|
{ = { PAGE} + { INCLUDETEXT "C:\\My Book\\Chap1.doc" Chap1Pages
\* CharFormat \! } }
Repeat the steps for each document in sequence.
Discussion: The INCLUDETEXT field can reference any document, and any bookmark within a document. Be sure to place the document path in "double-quotes", and to use double-backslashes. The bookmark name follows the path (Chap1Pages, in the above example). The \* CharFormat switch forces the field result to be formatted with the font settings in the target document, rather than bring the formatting with it (otherwise the result would be "hidden"). The \! switch prevents the PAGE field within the bookmark from updating to reflect the context in the target document.
More information on how to use fields.