select content of a page using a macro

  • Thread starter Thread starter Ashok
  • Start date Start date
A

Ashok

Hi ! I need to select all the content of a specific page number using a
macro. I read the basic info on macros but could not figure out how to do
that myself. Thanx in advance.
 
Use:

Dim pagenum As Long
pagenum = InputBox("Enter the page number.")
If pagenum <= ActiveDocument.BuiltInDocumentProperties(wdPropertyPages) Then
Selection.HomeKey wdStory
Selection.GoTo What:=wdGoToPage, Count:=pagenum
Selection.Bookmarks("\page").Range.Select
Else
MsgBox "The pagenumber that you entered does not exist in this
document."
End If


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
Back
Top