This documentation is archived and is not being maintained.

Bookmark.Document Property

 

Gets the Microsoft.Office.Interop.Word.Document associated with the Bookmark control.

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

Document Document { get; }

The following code example adds a Bookmark control to the first paragraph in the document and then displays the name of the document containing the bookmark.

This example is for a document-level customization.

private void BookmarkDocument()
{
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");

    MessageBox.Show("bookmark1 is located in: " + 
        bookmark1.Document.FullName);
}
Return to top
Show: