Proprietà DocumentBase.Indexes

Ottiene un insieme di Indexes che rappresenta tutti gli indici del documento.

Spazio dei nomi:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Sintassi

'Dichiarazione
Public ReadOnly Property Indexes As Indexes
    Get
public Indexes Indexes { get; }

Valore proprietà

Tipo: Microsoft.Office.Interop.Word.Indexes
Insieme di Indexes che rappresenta tutti gli indici del documento.

Esempi

Nell'esempio di codice riportato di seguito viene illustrato come aggiungere testo al primo paragrafo e come inserire una voce di indice. Viene infine illustrato come aggiungere un indice al secondo paragrafo. Per utilizzare questo esempio, eseguirlo dalla classe ThisDocument in un progetto a livello di documento.

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);
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

DocumentBase Classe

Spazio dei nomi Microsoft.Office.Tools.Word