total number of pages in all open docs 
Author Message
 total number of pages in all open docs

I need a (simple?) macro that will give me the total number of pages in all
open documents in Word.  I thought I could build up a numeric variable
adding the value of Number of Pages from Doc Properties, but I don't seem to
be able to do this.  Any suggestions?


Fri, 06 Sep 2002 03:00:00 GMT  
 total number of pages in all open docs
Hi Rachel,

Hope this is simple enough for you:

Dim adoc As Document
totalpages = 0
For Each adoc In Application.Documents
    totalpages = totalpages + adoc.Range.Information(wdActiveEndPageNumber)
Next adoc
MsgBox "Total pages in open documents = " & totalpages & "."

Hope this helps,
Doug Robbins - Word MVP
Please post any follow-up to the Newsgroups so that others may benefit
therefrom or contribute thereto.

Quote:
> I need a (simple?) macro that will give me the total number of pages in
all
> open documents in Word.  I thought I could build up a numeric variable
> adding the value of Number of Pages from Doc Properties, but I don't seem
to
> be able to do this.  Any suggestions?



Fri, 06 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Adding Total Number of slides to the page number field in the footer

2. Word not printing total number of pages in page footer correctly

3. Page number totals...

4. total number of pages in VBA word

5. running total page numbers

6. Total Number Pages in Report?

7. total number of pages

8. Total Number of Pages from Formula

9. Crystal - Displaying Total Number of Pages to be Printed

10. Total number of pages in a report?

11. How To Detect Total Page Number ?

12. Total page number

 

 
Powered by phpBB® Forum Software