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 / December 2004

Tip: Looking for answers? Try searching our database.

How to retrieve active page number from code?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert L - 10 Dec 2004 09:05 GMT
Hi All,

How can I retrieve active page number (the number that is displayed in the
status bar's left-most panel) from VBA code? I am using Word 2000.

Thank you in advance
Robert
David Mathi Raj - 10 Dec 2004 09:28 GMT
Hi! Roby !!

Select INSERT menu, then select FIELD,
under the CATEGORIES, select NUMBERING
then under the field names select PAGE.

You got it.
Robert L - 10 Dec 2004 09:49 GMT
Thank you very much for your help.

regards,
Robert
Jean-Guy Marcil - 10 Dec 2004 20:19 GMT
Robert L was telling us:
Robert L nous racontait que :

> Thank you very much for your help.

I am not sure how David's answer helped you. You asked about VBA code to get
the current page number, and he told you how to insert a page number on a
page...

If that is what you wanted, then great, and I must say he has a very good
crystal ball!

If not, look up the Selection.Information property:

'_______________________________________
Dim AbsolutePageNum As Variant
AbsolutePageNum = Selection.Information(wdActiveEndPageNumber)
'_______________________________________

   will return the page count from the beginning of the document

'_______________________________________
Dim RelativePageNum As Variant
RelativePageNum = Selection.Information(wdActiveEndAdjustedPageNumber)
'_______________________________________

   will return the page count according to manual changes (if a section was
restarted at some numbers, etc.)

Signature

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

Robert L - 13 Dec 2004 09:31 GMT
Hi Jean-Guy,

You are right. He answered something else, but I was quite busy at the time
I was reading the answer and moreover, in the meantime I decided not to
include page numbers in my macro output. So I just thanked him for his
answer. Anyway I see you are a good reader :) and a man who wants to give
the correct answer to the question.
I will try your procedure for sure and use in some future macros.

Thank you very much for your advice and help. I appreciate this much.
Regards,
Robert

Rate this thread:






 
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.