Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • 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
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.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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