Header liner count

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know if there is a Word macro command to find out how many lines
are in a document's header?

I have tried the following:

ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.EndKey Unit:=wdStory
LineNum = Selection.Information(wdFirstCharacterLineNumber)

but it just returns a value of -1. In fact it returns a value of -1 for any
line in the header. It apparently only works in the main document text area.
Many thanks.
 
Geoff:

I haven't tried this in a header. I developed it for use in a cell. Seems
like it might work though...

Dim objRange As Range
Dim intRowLines As Integer

' Your code to set the objRange to the header content goes here

intRowLines = objRange.ComputeStatistics(wdStatisticLines)

Bear
 

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

Back
Top