Readability statistics - VBA Code

A

andreas

Dear experts:

below macro that I copied from some Online VBA tutorial works in Word
2007 but inexplicably not in 2003.

Any idea why?

Help is much appreciated. Thank you very much in advance. Regards,
Andreas


Sub readabilitystatistics()
Dim StatText As String
Dim rs As Variant
StatText = "Document Statistics:" & vbCr
For Each rs In ActiveDocument.readabilitystatistics
StatText = StatText & rs.Name & " - " & rs.Value & vbCr
Next rs
MsgBox StatText

End Sub
 
D

Doug Robbins - Word MVP

It works fine in Word 2003 here, returning

Document Statistics:
Words - 84505
Characters - 413533
Paragraphs - 1965
Sentences - 3950
Sentences per Paragraph - 2.3
Words per Sentence - 20.3
Characters per Word - 4.7
Passive Sentences - 0
Flesch Reading Ease - 54.9
Flesch-Kincaid Grade Level - 10.4

for the document on which I ran it.



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
A

andreas

It works fine in Word 2003 here, returning

Document Statistics:
Words - 84505
Characters - 413533
Paragraphs - 1965
Sentences - 3950
Sentences per Paragraph - 2.3
Words per Sentence - 20.3
Characters per Word - 4.7
Passive Sentences - 0
Flesch Reading Ease - 54.9
Flesch-Kincaid Grade Level - 10.4

for the document on which I ran it.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com











- Zitierten Text anzeigen -

Hi Doug,

ok, thanks for double-checking. Still it does not work on my machine.
May something is wrong with my normal.dot. I keep trying.

Thank you. Regards, Andreas
 
C

Chunsheng Li

why the passive sentences is zero?

andreas said:
Hi Doug,

ok, thanks for double-checking. Still it does not work on my machine.
May something is wrong with my normal.dot. I keep trying.

Thank you. Regards, Andreas
.
 

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