Class ReadabilityStatistic (Word VBA)

The class ReadabilityStatistic represents one of the readability statistics for a document or range. The ReadabilityStatistic object is a member of the ReadabilityStatistics collection.

Set

To use a ReadabilityStatistic class variable it first needs to be instantiated, for example

Dim rsc as ReadabilityStatistic
Set rsc = ActiveDocument.Range.ReadabilityStatistics(Index:=1)

The following procedures can be used to set variables of type ReadabilityStatistic: ReadabilityStatistics.Item, Document.ReadabilityStatistics and Range.ReadabilityStatistics

For Each

Here is an example of processing the ReadabilityStatistic items in a collection.

Dim rsc As ReadabilityStatistic
For Each rsc In ActiveDocument.Range.ReadabilityStatistics
	
Next rsc

Name

Returns the name of the specified object.

Dim strName As String
strName = ActiveDocument.Range.ReadabilityStatistics(1).Name

Parent

Returns an object that represents the parent object of the specified ReadabilityStatistic object.

Dim objParent As Object
Set objParent = ActiveDocument.Range.ReadabilityStatistics(1).Parent

Value

Returns the value of the grammar statistic.

ActiveDocument.CheckGrammar 
MsgBox ActiveDocument.ReadabilityStatistics( _ 
 "Flesch Reading Ease").Value

ReadabilityStatistics.Count

Returns a Long that represents the number of readability statistics in the collection.

Dim lngCount As Long
lngCount = ActiveDocument.Range.ReadabilityStatistics.Count

ReadabilityStatistics.Item

Returns an individual ReadabilityStatistic object in a collection.

Syntax : expression.Item (Index)

Index: The individual object to be returned. Can be a Long indicating the ordinal position or a String representing the name of the individual object.

Dim rsc As ReadabilityStatistic
Set rsc = ActiveDocument.Range.ReadabilityStatistics(Index:=1)

ReadabilityStatistics.Parent

Returns an object that represents the parent object of the specified ReadabilityStatistics object.

Dim objParent As Object
Set objParent = ActiveDocument.Range.ReadabilityStatistics.Parent