Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2005

Tip: Looking for answers? Try searching our database.

Find # of Pages in First Section of Document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ehale - 25 Oct 2005 23:38 GMT
Hello,

I need to determine the number of pages in the first section of a document
using vba.  Anyone know how?  Any help is very appreciated, thanks!
Jay Freedman - 26 Oct 2005 04:26 GMT
>Hello,
>
>I need to determine the number of pages in the first section of a document
>using vba.  Anyone know how?  Any help is very appreciated, thanks!

ActiveDocument.Sections(1).Range.Information(wdActiveEndPageNumber)

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Tony Jollans - 26 Oct 2005 12:11 GMT
That only works for the first section. For others you must subtract the end
page of the previous section, for example ..

ActiveDocument.Sections(2).Range.Information(wdActiveEndPageNumber)-ActiveDo
cument.Sections(1).Range.Information(wdActiveEndPageNumber)

I kind of think there ought to be a better way but don't know it. Also be
aware that this will not always give the same answer as {SECTIONPAGES} if
you have continuous section breaks.

--
Enjoy,
Tony

> >Hello,
> >
[quoted text clipped - 7 lines]
> Jay Freedman
> Microsoft Word MVP        FAQ: http://word.mvps.org
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.