Share via


Document.Indexes Property (2007 System)

Gets an Indexes collection that represents all the indexes in the document.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Indexes As Indexes
'Usage
Dim instance As Document 
Dim value As Indexes 

value = instance.Indexes
[BrowsableAttribute(false)]
public Indexes Indexes { get; }
[BrowsableAttribute(false)]
public:
property Indexes^ Indexes {
    Indexes^ get ();
}
public function get Indexes () : Indexes

Property Value

Type: Indexes
An Indexes collection that represents all the indexes in the document.

Examples

The following code example adds text to the first paragraph and inserts an index entry. The code then adds an index to the second paragraph.

This example is for a document-level customization.

Private Sub DocumentIndexes()

    Me.Paragraphs(1).Range.Text = "This is sample text." & vbLf
    Dim entry As Object = Me.Paragraphs(1).Range.Text
    Dim headingSeparator As Object = False 

    Me.Indexes.MarkEntry(Me.Paragraphs(1).Range, entry)

    Dim Type As Object = Word.WdIndexType.wdIndexRunin
    Me.Indexes.Add(Me.Paragraphs(2).Range, headingSeparator, , Type)

End Sub
private void DocumentIndexes()
{

    this.Paragraphs[1].Range.Text = "This is sample text." + "\n";
    object entry = this.Paragraphs[1].Range.Text;
    object headingSeparator = false;

    this.Indexes.MarkEntry(this.Paragraphs[1].Range,
        ref entry, ref missing, ref missing, ref missing,
        ref missing, ref missing, ref missing, ref missing);


    object Type = Word.WdIndexType.wdIndexRunin;
    this.Indexes.Add(this.Paragraphs[2].Range, 
        ref headingSeparator, ref missing, ref Type,
        ref missing, ref missing, ref missing, 
        ref missing);
}

.NET Framework Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace