Bookmark.BeforeDoubleClick Event

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Occurs when a Bookmark control is double-clicked, before the default double-click action.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

event ClickEventHandler BeforeDoubleClick

Double-clicking overlapping Bookmark controls raises the event on each of the bookmarks that overlap.

The following code example adds a Bookmark control with the text to the document and then creates a BeforeDoubleClick event handler. The text within the bookmark is selected when the Bookmark control is double-clicked.

This example is for a document-level customization.

Microsoft.Office.Tools.Word.Bookmark bookmark2;

private void BookmarkBeforeDoubleClick()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    bookmark2 =	this.Controls.AddBookmark(this.Paragraphs[1]
        .Range, "bookmark2");
    bookmark2.Text = "This is a sample bookmark.";
    bookmark2.BeforeDoubleClick += new Microsoft.Office.Tools
        .Word.ClickEventHandler(bookmark2_BeforeDoubleClick);
}

void bookmark2_BeforeDoubleClick(object sender, 
    Microsoft.Office.Tools.Word.ClickEventArgs e)
{
    bookmark2.Select();
    e.Cancel = true;
}

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft