Fields Collection Object
Word Developer Reference |
A collection of Field objects that represent all the fields in a selection, range, or document.
Remarks
Use the Fields property to return the Fields collection. The following example updates all the fields in the selection.
Note |
---|
Use the Fields property with a MailMerge object to return a MailMergeFields collection. |
Visual Basic for Applications |
---|
|
Use the Add method to add a field to the Fields collection. The following example inserts a DATE field at the beginning of the selection and then displays the result.
Visual Basic for Applications |
---|
|
Use Fields(Index), where Index is the index number, to return a single Field object. The index number represents the position of the field in the selection, range, or document. The following example displays the field code and the result of the first field in the active document.
Visual Basic for Applications |
---|
|
The Count property for this collection in a document returns the number of items in the main story only. To count items in other stories use the collection with the Range object.
See Also