DocumentBase.Indexes Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient une collection Indexes qui représente tous les index dans le document.
public Microsoft.Office.Interop.Word.Indexes Indexes { get; }
Valeur de propriété
Collection Indexes qui représente tous les index dans le document.
Exemples
L’exemple de code suivant ajoute du texte au premier paragraphe et insère une entrée d’index. Le code ajoute ensuite un index au deuxième paragraphe. Pour utiliser cet exemple, exécutez-le à partir de la ThisDocument classe dans un projet au niveau du document.
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);
}
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