Hi sbrbot,
I took the approach I used because your post didn't indicate that the document had any material you wanted to treated differently. You need to be clear about your requirements. You could easily enough modify the code to work on only a selected or specified range.
As for the Heading Style names, I accept what you say as fair comment. Again, you could easily modify the code to work with wdStyleHeading1 and wdStyleHeading2.
As for your question about processing a document line, by line, you need to keep in mind that Word has a very flexible interpretation of what a line is. That's because Word uses the active printer's driver to determine the page layout. Consequently, the amount of test that fits on one line can vary from printer to printer, and even with the same printer if different drivers are used. So, with that in mind, here's some code to count the number of lines in a selection.
Sub GetLineCount()
Dim MyRange As Range, LineCount As Long
Set MyRange = Selection.Range
Selection.Collapse wdCollapseStart
While Selection.InRange(MyRange) = True
LineCount = LineCount + 1
Selection.MoveDown Unit:=wdLine, Count:=1
Wend
MyRange.Select
MsgBox LineCount
End Sub