Find a page based on page # the user has selected

J

James

The user will type in page x to page y. How would I find page x (to do
some formatting, lets say)? And then how would I continue until I hit
page y?
Thanks.
 
H

Helmut Weber

Hi James,
like this:
Sub Test633()
Dim x As Integer ' page to start with
Dim y As Integer ' page to end with
Dim i As Integer ' a counter
x = 13 ' you can handle this input by an inputbox
y = 17 ' or by a userform, e.g.?
For i = x To y
Selection.GoTo _
what:=wdGoToPage, _
which:=wdGoToAbsolute, _
Count:=i
Selection.Bookmarks("\page").Select
stop ' do what you like to the selection
Next
End Sub
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top