It could be simple, but I can not find how to do it:
I need a code to get the page number of some range object, let me say, I
have a paragraph, and I want to know his location (page number) when printed.
Thanks, yours, Daniel
from Brazil
Jean-Guy Marcil - 12 Mar 2007 16:33 GMT
Daniel was telling us:
Daniel nous racontait que :
> It could be simple, but I can not find how to do it:
>
> I need a code to get the page number of some range object, let me
> say, I have a paragraph, and I want to know his location (page
> number) when printed.
Did you see the post named : "How to get the current page number?" from 3
days ago?
In VBA you would use the Information property:
MsgBox Selection.Information(wdActiveEndPageNumber)
MsgBox Selection.Information(wdActiveEndAdjustedPageNumber)
where the first one gives you the absolute page count in the document and
the second the page number as defined in the Page Number formatting dialog
(Insert menu > Page Numbers...)

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org