Compartilhar via


DocumentBase.ReadabilityStatistics Property

Gets a ReadabilityStatistics collection that represents the readability statistics for the document.

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

Syntax

'Declaration
Public ReadOnly Property ReadabilityStatistics As ReadabilityStatistics
public ReadabilityStatistics ReadabilityStatistics { get; }

Property Value

Type: Microsoft.Office.Interop.Word.ReadabilityStatistics
A ReadabilityStatistics collection that represents the readability statistics for the document.

Examples

The following code example adds text to the first paragraph in the document, and then displays a message that shows the number of words in the document by using the ReadabilityStatistics property. To use this example, run it from the ThisDocument class in a document-level project.

Private Sub DocumentReadabilityStatistics()
    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Me.Paragraphs(1).Range.Text = "This is sample text." 
    Dim Index As Object = 1

    Dim Name As String = Me.ReadabilityStatistics.Item(Index).Name.ToString()
    Dim Value As String = Me.ReadabilityStatistics.Item(Index).Value.ToString()

    MessageBox.Show(Name & ": " & Value)
End Sub
private void DocumentReadabilityStatistics()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    this.Paragraphs[1].Range.Text = "This is sample text.";
    string Name = this.ReadabilityStatistics[1].Name.ToString();
    string Value = this.ReadabilityStatistics[1].ToString();
    MessageBox.Show(Name + ": " + Value);

}

.NET Framework Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace