Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word (97) page count 1

Status
Not open for further replies.

nigz

Programmer
Jun 15, 2001
60
GB
This has been driving me mad. How do I, in code, workout the length of a document in page numbers? I've tried this but it always gives me 1.....arghhhhhh!!!!

Selection.Range.Sections _
(Selection.Range.Sections.Count).Headers _
(wdHeaderFooterPrimary).PageNumbers.Count

I would be so grateful - also for an explanation because I am obviously missing something fundemental here - Nigz
 
You need to repaginate before the count gets updated.
 
Use:
<document reference>.Range.Information(wdNumberOfPagesInDocument)

M :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top