• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

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...
0
nonlinearly
Asked:
nonlinearly
  • 2
1 Solution
 
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
 
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

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now