Index Object

Index Object
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Indexes
Aa662264.parchild(en-us,office.10).gifIndex
Aa662264.space(en-us,office.10).gifAa662264.parchild(en-us,office.10).gifRange

Represents a single index. The Index object is a member of the Indexes collection. The Indexes collection includes all the indexes in the specified document.

Using the Index Object

Use Indexes(index), where index is the index number, to return a single Index object. The index number represents the position of the Index object in the document. The following example updates the first index in the active document.

  If ActiveDocument.Indexes.Count >= 1 Then
    ActiveDocument.Indexes(1).Update
End If

Use the Add method to create an index and add it to the Indexes collection. The following example creates an index at the end of the active document.

  Set myRange = ActiveDocument.Content
myRange.Collapse Direction:=wdCollapseEnd
ActiveDocument.Indexes.Add Range:=myRange, Type:=wdIndexRunin