FracinDean
Board Regular
- Joined
- Jul 11, 2011
- Messages
- 110
- Office Version
- 365
- Platform
- Windows
I'm trying to generate word lists that meet certain tests. I would like to use Spellcheck to decide when something is actually a word. I am able to determine if something is a word from the CheckSpelling method return value "TRUE" or "FALSE", but I have not been able to determine how to close the spell check dialogue box from within my code. I don't want the user to have to do anything to close the dialogue box, but rather to have the code do it. I always want to select the "Cancel" option for the dialogue box. I think the issue is how to programmatically respond to a dialogue box when the fact that the dialogue opened has paused the execution of your code. Here is my example code:
Code:
Dim isWord as Boolean, wordToCheck as string
Range("myWord").Select
wordToCheck = Selection.Value
isWord = Selection.CheckSpelling(wordToCheck)
Msgbox ("Result is " & isWord)