setting a range to check (was: Re: VBA count of mis-spelled words?)
- From: "KR" <nospam@xxxxxxxxxx>
- Date: Fri, 7 Jul 2006 10:24:41 -0400
Jonathan and Shauna-
Thank you for your reply- I'm usually in Excel VBA, and sometimes it takes a
whack with the obvious when I switch applications ;-)
Based on the spelling errors count (and some quick testing), it appears that
if the user is in the middle of typing a word when this code is fired, it
will count an extra error for the half-spelled word (unless the half
represents a different word in the dictionary).
I took a quick search using "range" as a keyword, but didn't see anything
that would easily explain how to switch the range from the whole document,
to everything minus the last word in the document (if this is even the best
approach?). I'll be doing this check without alerting or interrupting the
user, so I'd like to avoid having the range calculation affect the cursor
position in the document.
Many thanks,
Keith
"Jonathan West" <jwest@xxxxxxxx> wrote in message
news:%235gi0NcoGHA.3636@xxxxxxxxxxxxxxxxxxxxxxx
"KR" <nospam@xxxxxxxxxx> wrote in message
news:eiAEqHcoGHA.4960@xxxxxxxxxxxxxxxxxxxxxxx
How can I get a count of mis-spelled words in a document, using VBA?
Basically, the number of words with the red squiggly underline, although
related errors like mixed capitalization would also be of interest
especially if I could keep that count separate from the basic count of
mis-spelled words.
Thanks!
ActiveDocument.Range.SpellingErrors.Count returns the number of spelling
errors in the body of the document.
If you look up SpellingErrors in the VBA Help file, you will see what else
you might be able to do. For instance, the SpellingErrors object is a
collection of Range objects, so you can iterate through the collection and
get the text of each individual spelling error.
--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
.
- Follow-Ups:
- Re: setting a range to check (was: Re: VBA count of mis-spelled words?)
- From: Jonathan West
- Re: setting a range to check (was: Re: VBA count of mis-spelled words?)
- References:
- VBA count of mis-spelled words?
- From: KR
- Re: VBA count of mis-spelled words?
- From: Jonathan West
- VBA count of mis-spelled words?
- Prev by Date: Re: Fill - in form - add rows to table
- Next by Date: Re: Word 2000 - fade edges of photo inserted in document
- Previous by thread: Re: VBA count of mis-spelled words?
- Next by thread: Re: setting a range to check (was: Re: VBA count of mis-spelled words?)
- Index(es):
Relevant Pages
|