Solved

Check Number of Pages per section

Posted on 2013-10-23
3
224 Views
Last Modified: 2013-10-23
Hi,
I need to check which sections have more than 1 page... (vba solution is ok...)
I am using Word 2010...
0
Comment
Question by:nonlinearly
  • 2
3 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39593921
You could put  SectionPages field in the header. If the headers are are linked, the field will be in all headers.
0
 

Author Comment

by:nonlinearly
ID: 39594041
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
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 39595552
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

If you work with Word a lot, you probably use styles. If you use styles a lot, you've probably balled your fist more often than not when working with the ribbon. In Word 2007/2010, one of the things that I find missing when using styles is a quic…
The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now