Check Number of Pages per section

Hi,
I need to check which sections have more than 1 page... (vba solution is ok...)
I am using Word 2010...
nonlinearlyAsked:
Who is Participating?
 
GrahamSkanRetiredCommented:
OK. How about this?
Sub ReportSectionPageCount()
    Dim sec As Section
    Dim iPageNumber As Integer
    Dim iPrevNumber As Integer
    For Each sec In ActiveDocument.Sections
        iPageNumber = sec.Range.Information(wdActiveEndPageNumber)
        MsgBox "Number of pages in section " & sec.index & " = " & iPageNumber - iPrevNumber
        iPrevNumber = iPageNumber
    Next sec
End Sub

Open in new window

0
 
GrahamSkanRetiredCommented:
You could put  SectionPages field in the header. If the headers are are linked, the field will be in all headers.
0
 
nonlinearlyAuthor Commented:
I prefer a solution with VBA because I have to check 80 files one-by-one and each file has more than 3.000 or 5.000 pages... so it will not obvious which sections will have more than 1 page
thank
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.