Expand Minimize

Bookmark.Name Property

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

Gets the name of the Bookmark control.

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

string Name { get; set; }

Property Value

Type: System.String
The name of the Bookmark control.

The following code example adds a Bookmark control with text to the first paragraph and then displays the bookmark's name in a message box.

This example is for a document-level customization.

private void BookmarkName()
{
    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.";
    MessageBox.Show("The bookmark's name is " + bookmark1.Name);
}

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