Dim Title as String, MyValue as String, Counter as Long
Message = "Enter the word for which you need the number of occurences" '
Set prompt.
Title = "InputBox Demo" ' Set title.
'Display Input Box.
MyValue = InputBox(Message, Title)
Selection.HomeKey Unit:=wdStory|
With ActiveDocument.Content.Find
.MatchWholeWord = True
Counter = 0
Do While .Execute(FindText:=MyValue, Forward:=True) = True
Counter = Counter + 1
Loop
End With
MsgBox "The word " + MyValue + " appears" + Str$(Counter) + " times."
--
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