Link to home
Start Free TrialLog in
Avatar of Glowman
GlowmanFlag for United States of America

asked on

Spell Checking

Hi there,
I am trying to create an app that utilizes Word's spell check functionality, but I am having a hard time figuring out what to do when the CheckSpelling() method comes back with a false value.  I will award the points to anyone who can show  me an example.  BTW I base my assumptions on using the Word Object and I instatiate it like so:
Public WordTool As New Word.Document
with a reference in the project to "Microsoft Word 8.0 Object libraray"
Thanks in advance
G
ASKER CERTIFIED SOLUTION
Avatar of twalgrave
twalgrave

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Glowman

ASKER

Excellent so far,
Just one more thing and you can have the points.
How can I get it to give me only the top option and not a list of all choices?
G
Avatar of twalgrave
twalgrave

I'm not positive, but I think the first item in the list after a call to GetSpellingSuggestions is the best suggestion and it goes downhill from there.  That seems to be the way Word produces them.
Avatar of Glowman

ASKER

ok, fair enough,
Thanks for the prompt response.
You could test for the first item that meets the SpellingErrorType  condition if you are concerned that you might receive Capitalization errors before "Not in Dictionary" errors like:

If suggs.SpellingErrorType = wdSpellingNotInDictionary Then
    StatusBar = "Unknown word"
End If