Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Feb 2003
    Annapolis, Maryland, USA
    Thanked 0 Times in 0 Posts

    readability report (2002)

    Is there a way to put the report from a given document into manipulable text?

    Or can I trick out the document properties so that they include the readability stats?

    I need to run a readability report on about 350 files. Ideally, I'd like to automate everything so that I could run a macro on all the documents in a folder and then convince Word to generate a report tying the readability statistics to each filename. But I don't think that's possible, so an answer to either of my first two questions would be very much appreciated.
    Michael Coleman
    BOMI International

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Silicon Valley, USA
    Thanked 94 Times in 90 Posts

    Re: readability report (2002)

    There are two parts to this project, of course, (1) looping through all the documents, and (2) extracting the readability statistics. This code demonstrates the second part, there are many threads here and on the VB/VBA board providing guidance on the first part.

    Sub TestReadability()
    ' Feed two document objects to the DumpStats procedure
    Dim docOld As Document, docNew As Document
    Set docOld = ActiveDocument
    Set docNew = Documents.Add 'Blank document for report
    docNew.Content.InsertAfter "Readability Report" & vbCrLf
    DumpStats docTarget:=docOld, docReport:=docNew
    ' Clean up objects and display report
    If Not (docOld Is Nothing) Then Set docOld = Nothing
    If Not (docNew Is Nothing) Then
    Set docNew = Nothing
    End If
    End Sub

    Sub DumpStats(docTarget As Document, docReport As Document)
    ' Dump the file name and readability statistics of the first file into the second
    Dim stat As ReadabilityStatistic
    docReport.Content.InsertAfter vbCrLf & docTarget.FullName & vbCrLf
    For Each stat In docTarget.ReadabilityStatistics
    docReport.Content.InsertAfter stat.Name & ": " & stat.Value & vbCrLf
    Set docReport = Nothing
    Set docTarget = Nothing
    End Sub

    Hope this helps.

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Los Angeles Area, California, USA
    Thanked 0 Times in 0 Posts

    Re: readability report (2002)

    Hi Michael:
    <hr>Is there a way to put the report from a given document into manipulable text?<hr>
    I'm not sure that this will accomplish what you want overall, but you can certainly insert each document into a single document. You can also generate readability statistics for each separately by selecting only that portion of the document before running a grammer check.

    You could also use {INCLUDETEXT} fields to show each of the reports in one document & generate readability statistics by selecting each field in turn & running the grammer check. If you want to make changes in the source document, you can edit the text in the field & then press Ctrl+Shift+F7.

    Hope this helps,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts