Bookmark.Copy Method ()


Creates a new Microsoft.Office.Interop.Word.Bookmark in the same location as the existing Microsoft.Office.Tools.Word.Bookmark control.

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

void Copy()

The following code example adds a Bookmark control to the document and then creates a BeforeRightClick event handler. When the Bookmark control is right-clicked, the text within the bookmark is copied to the Clipboard.

This example is for a document-level customization.

Microsoft.Office.Tools.Word.Bookmark bookmark3;

private void BookmarkBeforeRightClick()
    bookmark3 = this.Controls.AddBookmark(this.Paragraphs[1]
        .Range, "bookmark3");
    bookmark3.Text = "This is a sample bookmark.";
    bookmark3.BeforeRightClick += new Microsoft.Office.Tools

void bookmark3_BeforeRightClick(object sender, 
    Microsoft.Office.Tools.Word.ClickEventArgs e)
    e.Cancel = true;
Return to top