Class Field (Word VBA)
To use a Field class variable it first needs to be instantiated, for example
Dim fld as Field Set fld = ActiveDocument.Fields(Index:=1)
The following procedures can be used to set variables of type Field: Next, Previous, Fields.Add, Fields.Item, Indexes.MarkEntry, InlineShape.Field, Selection.NextField, Selection.PreviousField, TablesOfAuthorities.MarkCitation, TablesOfContents.MarkEntry and TablesOfFigures.MarkEntry.
Here is an example of processing the Field items in a collection.
Dim fld As Field For Each fld In ActiveDocument.Fields If fld.LinkFormat.AutoUpdate = False Then fld.LinkFormat.Update Next fld
Copy - Copies the specified field to the Clipboard.
Cut - Removes the specified field from the document and places it on the Clipboard.
Delete - Deletes the specified field.
DoClick - Clicks the specified field.
Select - Selects the specified field.
Unlink - Replaces the specified field with its most recent result.
Update - Updates the result of the field. Returns True if the field is updated successfully.
UpdateSource - Saves the changes made to the results of an INCLUDETEXT field back to the source document.
Data returns or sets data in an ADDIN field.
Index returns a Long that represents the position of an item in a collection.
Kind returns the type of link for a Field object.
Locked true if the specified field is locked.
Next returns the next object in the collection.
Previous returns the previous object in the collection.
ShowCodes true if field codes are displayed for the specified field instead of field results.
Type returns the field type.
InlineShape - Represents an object in the text layer of a document. An inline shape can only be a picture, an OLE object, or an ActiveX control. The InlineShape object is a member of the InlineShapes collection. The InlineShapes collection contains all the shapes that appear inline in a document, range, or selection.
LinkFormat - Represents the linking characteristics for an OLE object or picture.
OLEFormat - Represents the OLE characteristics (other than linking) for an OLE object, ActiveX control, or field.
Range - Represents a contiguous area in a document. Each Range object is defined by a starting and ending character position.