Hi Greg,
Like this:
Dim Message, Title, myword, Msg, previouspage As Long
Message = "Enter the word that you are looking for." ' Set prompt.
Title = "Word Finder" ' Set title.
' Display message and title.
myword = InputBox(Message, Title)
Msg = "The word " & myword & " appears on the following pages: "
previouspage = 0
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:=myword, Wrap:=wdFindStop, Forward:=True) =
True
If Selection.Information(wdActiveEndPageNumber) > previouspage Then
Msg = Msg & Selection.Information(wdActiveEndPageNumber) & ", "
previouspage = Selection.Information(wdActiveEndPageNumber)
End If
Loop
End With
Msg = Left(Msg, Len(Msg) - 2) & "."
MsgBox Msg
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP