Perform readability statistics

Q

Question Boy

Hello,

I know that I can get the readability statistics when I execute a grammar
check, but is there a way to simply execute the readability statistics
without running a complete grammar check. Just run it on the text as is? i
am specifically trying to get the Flesch score for a document at the click of
a button without any interaction on the behalf of the user.

Thank you,

QB
 
J

Jean-Guy Marcil

Question Boy said:
Hello,

I know that I can get the readability statistics when I execute a grammar
check, but is there a way to simply execute the readability statistics
without running a complete grammar check. Just run it on the text as is? i
am specifically trying to get the Flesch score for a document at the click of
a button without any interaction on the behalf of the user.

Sub Readability()

Dim rsDoc As ReadabilityStatistic

Set rsDoc = ActiveDocument.Range.ReadabilityStatistics(9)

MsgBox "Readability for this document: " & rsDoc.Value & "."

End Sub


You may need to add code to make sure that the whole document is set to the
same language or an error will be generated.
 
C

Charlie Mac

QB,

Try this:

Dim rs As Variant ' ReadabilityStatistics, StatText as string
StatText = "Document Statistics:" & vbCr
For Each rs In Documents(1).ReadabilityStatistics
StatText = StatText & rs.Name & " - " & rs.Value & vbCr
Next rs
MsgBox StatText

Charlie in Texas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top