Document.Sentences Property (2007 System)

Gets a Sentences collection that represents all the sentences in the document.

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

[BrowsableAttribute(false)]
public Sentences Sentences { get; }

Property Value

Type: Sentences
A Sentences collection that represents all the sentences in the document.

The following code example adds two sentences to the document, and then displays a message that shows the number of sentences in the document.

This example is for a document-level customization.

private void DocumentSentences()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    this.Paragraphs[1].Range.Text = "This is sample text." +
        " There are two sentences in this document.";

    MessageBox.Show("Total sentences: " + 
        this.Sentences.Count.ToString());
}

Community Additions

ADD
Show: