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)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Sentences As Sentences
'Usage
Dim instance As Document
Dim value As Sentences
value = instance.Sentences
[BrowsableAttribute(false)]
public Sentences Sentences { get; }
[BrowsableAttribute(false)]
public:
property Sentences^ Sentences {
Sentences^ get ();
}
public function get Sentences () : Sentences
Property Value
Type: Sentences
A Sentences collection that represents all the sentences in the document.
Examples
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 Sub DocumentSentences()
Me.Paragraphs(1).Range.InsertParagraphBefore()
Me.Paragraphs(1).Range.Text = "This is sample text." & _
" There are two sentences in this document."
MessageBox.Show("Total sentences: " & Me.Sentences.Count.ToString())
End Sub
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());
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.