Bookmark.HighlightColorIndex 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 ou définit la couleur de surbrillance du contrôle Bookmark.
public Microsoft.Office.Interop.Word.WdColorIndex HighlightColorIndex { get; set; }
Valeur de propriété
Une des valeurs de l'objet WdColorIndex.
Exemples
L’exemple de code suivant ajoute un Bookmark contrôle avec du texte au premier paragraphe, puis définit le HighlightColorIndex du troisième mot du signet sur jaune.
Cet exemple est destiné à une personnalisation au niveau du document.
private void BookmarkHighlightColorIndex()
{
this.Paragraphs[1].Range.InsertParagraphBefore();
Microsoft.Office.Tools.Word.Bookmark bookmark1 =
this.Controls.AddBookmark(this.Paragraphs[1].Range,
"bookmark1");
bookmark1.Text = "This is sample bookmark text.";
bookmark1.Words[3].HighlightColorIndex = Word.WdColorIndex.wdYellow;
}
Private Sub BookmarkHighlightColorIndex()
Me.Paragraphs(1).Range.InsertParagraphBefore()
Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")
Bookmark1.Text = "This is sample bookmark text."
Bookmark1.Words(3).HighlightColorIndex = _
Word.WdColorIndex.wdYellow
End Sub
Remarques
L’affectation de la valeur à cette propriété wdNoHighlight supprime la couleur de surbrillance (le cas échéant) du Bookmark contrôle.