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 / March 2007

Tip: Looking for answers? Try searching our database.

How to get page number with VBA in Word ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daniel - 12 Mar 2007 16:21 GMT
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

 
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.