I need to count the number of instances a specific word is used in a very large document. Hopefully using something that will return a "count()" result....

Re: Count instance of a specific word by Charles

Charles
Thu Feb 19 16:46:22 CST 2004

Within the document, replace the word with itself. Word will tell you how
many times it was found.
--

Charles Kenyon

See the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"EazyE" <anonymous@discussions.microsoft.com> wrote in message
news:60C627F2-E8D1-4860-886E-B23B0E5FD90E@microsoft.com...
> I need to count the number of instances a specific word is used in a very
large document. Hopefully using something that will return a "count()"
result....



Re: Count instance of a specific word by Doug

Doug
Sat Feb 21 19:56:20 CST 2004

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
"EazyE" <anonymous@discussions.microsoft.com> wrote in message
news:60C627F2-E8D1-4860-886E-B23B0E5FD90E@microsoft.com...
>I need to count the number of instances a specific word is used in a very
>large document. Hopefully using something that will return a "count()"
>result....



Re: Count instance of a specific word by anonymous

anonymous
Mon Mar 01 02:06:06 CST 2004

yead i c word will tell. But im wondering how we can retrieve that count programmaticall


Re: Count instance of a specific word by Klaus

Klaus
Mon Mar 01 20:01:49 CST 2004

You can find another macro in
http://word.mvps.org/faqs/macrosvba/GetNoOfReplacements.htm

Greetings,
Klaus