Expand Minimize
This topic has not yet been rated - Rate this topic

Bookmark.Name Property

Gets the name of the Bookmark control.

Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word (in microsoft.office.tools.word.dll)

public string Name { get; set; }

Property Value

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.

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);
}

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.