Indexes Property

Applies To

Document object.

Description

Returns an Indexes collection that represents all the indexes in the specified document. Read-only.

See Also

Add method (Indexes collection).

Example

This example adds an index at the end of the active document.

Set MyRange = ActiveDocument.Range(Start:=ActiveDocument.Content.End - 1, _
    End:=ActiveDocument.Content.End - 1)
ActiveDocument.Indexes.Add Range:=MyRange, NumberOfColumns:=1, _
    HeadingSeparator:=False
This example sets the number of columns and the page number alignment for the indexes in Report.doc.

For Each aIndex In Documents("Report.doc").Indexes
    aIndex.NumberOfColumns = 2
    aIndex.RightAlignPageNumbers = True
Next aIndex
This example inserts an index entry for the selected text.

If Selection.Type = wdSelectionNormal Then
    ActiveDocument.Indexes.MarkEntry Range:=Selection.Range, Entry:=Selection.Range.Text
End If