Bookmark.HighlightColorIndex Propriété

Définition

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é

WdColorIndex

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.

S’applique à