Microsoft Office Tutorials and References
In Depth Information
Displaying a Number in Millions as Text
This macro is designed to work with a generic index generated by the Insert |
Reference | Index and Table of Contents | Index dialog box, of the Indent type.
As it stands, it will not work with a Run-in type of index, although it could be
modified for this type of index. The number of columns is not important, nor
whether page numbers are right-aligned.
Displaying a Number in Millions as Text
Using this procedure, you can insert a complex set of nested fields to augment
Word's \* CardText and \* DollarText formatting switches to display numbers
in the millions as text. It also demonstrates how to check whether the selection
is in a field.
Example file:
Scenario: The Word object model provides no way to
create a set of nested fields using VBA. But often a more or
less complex set of Word fields is the only way to dynamically
display or bring data into Word, thus saving the user lots of
manual work.
In this example, to display a number in the millions as text,
Word's internal \* DollarText and \* CardText switches only
work up to 999,999.
Figure 47 – Displaying Numbers as Text
Search JabSto ::

Custom Search