The Anchorage
Personal website of Gregory K. Maxey, Commander USN (Retired)
The information, illustrations and code contained in my "Microsoft Word Tips" are provided free and without risk or obligation.
However, the work is mine. If you use it for commercial purposes or benefit from my efforts through income earned or time saved then a donation, however small, will help to ensure the continued availability of this resource.
If you would like to donate, please use the appropriate donate button to access PayPal. Thank you!
The purpose of this Microsoft Word Tips & Microsoft Word Help page is to provide help to the frustrated transcriptionist.
Transcriptionists often ask "How do I get an accurate count of lines in my document that actually contain text?"
The Word command "Word Count" generates a report listing the number of lines in a document. The report qualifies “all lines.” This includes lines that are empty but still available for holding text. There is a difference between an empty line (which is counted) and space between lines, which isn't.
Have a look at the two samples of text below. They both look the same and they both appear to have 6 lines of text.
However, the "Lines" count in a Word Count report of Sample I text returns eight (8). Surely a frustratingly inaccurate count for the transcriptionists.
A line count of the Sample II text returns six (6).
What is the difference? The first example contains empty lines!!
Toggle display of non-printing characters CTRL+SHIFT+* and you will see in the first example the ¶ paragraph symbol marking an empty line 3 and 5. Are these lines capable of holding text? Certainly! Empty lines are a result of undisciplined formatting. It is very easy and generally a bad habit to create space between lines by pressing the enter key. However, as this example has illustrated, you are not only generating space; you are also adding empty paragraphs, which count as lines.
Sample II, on the other, has disciplined paragraph formatting applied using the "Paragraph" dialog. As an alternative, you can quickly apply this formatting to any selected text with the keyboard shortcut CTRL+0.
Disciplined formatting should eliminate most of your problems with accurate line counting. However, if you refuse to get onboard, I have put together a few macros to overcome the error induced by undisciplined formatting.
Sub CountLinesOfText() Dim NumLines As Long With ActiveDocument.Range.Find .ClearFormatting .Format = False .Forward = True .Wrap = wdFindStop .MatchWildcards = True .Text = "[^13]{2,}" .Replacement.Text = "^p" .Execute Replace:=wdReplaceAll .Text = "[^l]{2,}" .Replacement.Text = "^l" .Execute Replace:=wdReplaceAll .Text = "^13^l" .Replacement.Text = "^p" .Execute Replace:=wdReplaceAll .Text = "^l^l3" .Replacement.Text = "^p" .Execute Replace:=wdReplaceAll End With NumLines = ActiveDocument.ComputeStatistics(wdStatisticLines) ActiveDocument.Undo 'ActiveDocument.Undo MsgBox ("The document contains " & NumLines & " Lines") Selection.HomeKey wdStory lbl_Exit: Exit Sub End Sub
Sub CountQualifiedLines() Dim CharCount As Integer Dim tCount As Integer Dim LineCount As Integer Dim Qualifier As String Qualifier = InputBox("Enter threshold line length." & vbCr + vbCr _ & "To be counted the line must contain the " _ & "threshold number of characters " _ & "(excluding the line end mark.)", _ "Line Length", 1) tCount = ActiveDocument.ComputeStatistics(wdStatisticLines) Selection.HomeKey wdStory Do While tCount > 0 With Selection .EndKey Unit:=wdLine, Extend:=wdExtend CharCount = .Characters.Count tCount = tCount - 1 On Error GoTo lbl_Exit If CharCount > Qualifier Then LineCount = LineCount + 1 End If .Collapse wdCollapseStart .MoveDown Unit:=wdLine, Count:=1 .EndKey Unit:=wdLine, Extend:=wdExtend End With Loop Selection.HomeKey wdStory MsgBox "There are " & LineCount & " qualified lines in this document" lbl_Exit: Exit Sub End Sub
See: Installing Macros for instructions on how to set up and use the macros provided in this Microsoft Word Help & Microsoft Word Tips page.
Bonus Tip: Create your own "Lorem ipsum ..." text in Word 2007/2010 by simply typing =lorem() and pressing enter. What is "Lorem ipsum?" See: Lorem Ipsum. For more dummy text methods see Word MVP Suzanne Barnhill's: Dummy Text
That's it! I hope you have found this Microsoft Word Help & Tips page useful and informative.
The information, illustrations and code contained in my "Microsoft Word Tips" are provided free and without risk or obligation.
However, the work is mine. If you use it for commercial purposes or benefit from my efforts through income earned or time saved then a donation, however small, will help to ensure the continued availability of this resource.
If you would like to donate, please use the appropriate donate button to access PayPal. Thank you!