'Go to Top of Documnet
Selection.HomeKey Unit:=wdStory
' Skip Cover Sheet
Application.Browser.Target = wdBrowsePage
Application.Browser.Next
'Store Current position
StartLocation = Selection.Range.Start
'Move To Next Heading
Application.Browser.Target = wdBrowseHeading
Application.Browser.Next
EndLocation = Selection.Range.Start
' Select fromstart to end
ActiveDocument.Range(Start:=StartLocation, End:=EndLocation).Select
' Get and Return the word count
wc = Selection.Range.Words.Count
MsgBox ("Words for this section are " & wc)
I can't see I have done something wrong inthe code; I can only see that the microsoft Selection object has the wrong value. Adding a watch to the selection also shows the High Value. Yet in the document at the same time the actual word count is the lower
number ( and correct)
To test : On the second page of the document place three paragraphs, Tow of style Heading 1 and the Middle paragraph a known number of words.