DocumentBase.Indexes (Propiedad)

Obtiene una colección Indexes que representa todos los índices del documento.

Espacio de nombres:  Microsoft.Office.Tools.Word
Ensamblado:  Microsoft.Office.Tools.Word.v4.0.Utilities (en Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Sintaxis

'Declaración
Public ReadOnly Property Indexes As Indexes
    Get
public Indexes Indexes { get; }

Valor de propiedad

Tipo: Microsoft.Office.Interop.Word.Indexes
Una colección Indexes que representa todos los índices del documento.

Ejemplos

En el ejemplo de código siguiente se agrega texto al primer párrafo y se inserta una entrada de índice. A continuación, el código agrega un índice al segundo párrafo. Para usar este ejemplo, ejecútelo desde la clase ThisDocument en un proyecto de nivel de 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);
}

Seguridad de .NET Framework

Vea también

Referencia

DocumentBase Clase

Microsoft.Office.Tools.Word (Espacio de nombres)