Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Word2000 Macro Page Number

Status
Not open for further replies.

1jelena

Programmer
Feb 20, 2003
3
0
0
US
I'm writing a Macro for Word 2000 where I need to know what is the current page number I am on in the Word document, and if I am hitting the last page. I am using VBA.

Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldPage ~inserts the current page

Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldNumPages ~inserts the number of all pages

What I am having problems doing is grabbing these numbers and assigning them to a variable.
If you please know how, I will be saved a lot of headache..
Help!
Thanks
1Jelena

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top