Bookmark.Sentences Property

Definition

Gets a Sentences collection that represents all the sentences in the Bookmark control.

C#
public Microsoft.Office.Interop.Word.Sentences Sentences { get; }

Property Value

A Sentences collection that represents all the sentences in the Bookmark control.

Examples

The following code example adds a Bookmark control with text to the document and then selects the first sentence in the bookmark.

This example is for a document-level customization.

C#
private void BookmarkSentences()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();

    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "This is the first sentence of bookmark text." +
        " And this is the second sentence.";
    bookmark1.Sentences.First.Select();
}

Applies to

Product Versions
Visual Studio Tools for Office 2017, 2019, 2022