Well that gets pretty gnarly ;-)
You could revise the code as follows:
Change:
SingleWord = Trim(LCase(aWord))
To:
SingleWord = Trim(aWord)
Change:
If SingleWord < "a" Or SingleWord > "z" Then
SingleWord = "" 'Out of range?
NonWordObjects = NonWordObjects + 1 '
End If
To:
If SingleWord < "A" Or SingleWord > "z" Or Asc(SingleWord) > 90 And
Asc(SingleWord) < 97 Then '= "[" Or SingleWord = "]" Then
SingleWord = "" 'Out of range?
NonWordObjects = NonWordObjects + 1 '
End If
But that would count "it" "IT" and "It" as three separatar words. I
haven't taken the time to figure out how to process the first word of a
sentence or how they should be counted. They are all in fact the same word
;-)
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
itgreenwich said:
Greg,
Great tool! How can I make it diferentitate between CAPITAL versions of a
word and non? For instance it versus IT.