>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