Document.Indexes property (Word)

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


expression. Indexes

expression A variable that represents a Document object.


For information about returning a single member of a collection, see Returning an object from a collection.


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, _ 

This example inserts an index entry for the selected text.

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

See also

Document Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.