Hi Mandy,
Use the ComputeStatistics function as follows
Dim i As Integer, arange As Range, j As Integer
i = ActiveDocument.ComputeStatistics(wdStatisticLines)
For j = 1 To ActiveDocument.Sections.Count
If
Len(ActiveDocument.Sections(j).Headers(wdHeaderFooterFirstPage).Range) > 1
Then
i = i +
ActiveDocument.Sections(j).Headers(wdHeaderFooterFirstPage).Range.ComputeSta
tistics(wdStatisticLines)
End If
If Len(ActiveDocument.Sections(j).Headers(wdHeaderFooterPrimary).Range)
i = i +
ActiveDocument.Sections(j).Headers(wdHeaderFooterPrimary).Range.ComputeStati
stics(wdStatisticLines)
End If
If
Len(ActiveDocument.Sections(j).Footers(wdHeaderFooterFirstPage).Range) > 1
Then
i = i +
ActiveDocument.Sections(j).Footers(wdHeaderFooterFirstPage).Range.ComputeSta
tistics(wdStatisticLines)
End If
If Len(ActiveDocument.Sections(j).Footers(wdHeaderFooterPrimary).Range)
i = i +
ActiveDocument.Sections(j).Footers(wdHeaderFooterPrimary).Range.ComputeStati
stics(wdStatisticLines)
End If
Next j
MsgBox i & " lines"
Once you have a single header or footer in a section, the other header
footer possibilities (First Page/Primary) get counted as containing a single
line, even if they are empty, hence checking the length of the range.
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP