Class Index (Word VBA)

The class Index 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.

To use a Index class variable it first needs to be instantiated, for example

Dim idx as Index
Set idx = ActiveDocument.Indexes(Index:=1)

The following procedures can be used to set variables of type Index: Indexes.Add and Indexes.Item.

For Each

Here is an example of processing the Index items in a collection.

Dim idx As Index
For Each idx In ActiveDocument.Indexes
	
Next idx

Methods

Delete - Deletes the specified index.

Update - Updates the entries shown in specified index.

Properties

AccentedLetters true if the specified index contains separate headings for accented letters (for example, words that begin with "À" are under one heading and words that begin with "A" are under another).

Filter returns or sets a value that specifies how Microsoft Word classifies the first character of entries in the specified index.read/write Long. Can be one of the following wdIndexFilter constants.

HeadingSeparator returns or sets the text between alphabetical groups (entries that start with the same letter) in the index. Corresponds to the \h switch for an INDEX field.

IndexLanguage returns or sets a WdLanguageID constant that represents the sorting language to use for the specified index.

NumberOfColumns sets or returns the number of columns for each page of an index.

Range returns a Range object that represents the portion of a document that is contained within an index.

RightAlignPageNumbers true if page numbers are aligned with the right margin in an index.

SortBy returns or sets the sorting criteria for the specified index.

TabLeader returns or sets the leader character between entries in an index and their associated page numbers.

Type returns or sets the index type.

Range - Represents a contiguous area in a document. Each Range object is defined by a starting and ending character position.