I am writing a spell check application in C# using word.dll
(the Word Interop API).
I want to check which spellings are incorrect and accordingly get s
Update: So it seems you need to get the first spelling suggestion from word. I checked this article and I deduce you would need to do something like this:
Word.SpellingSuggestions listOfSuggestions =
app.GetSpellingSuggestions(searchStr);
listOfSuggestions.Items[0].Name;//should contain the first suggestion
So from the msdn docs:
Syntax 1
expression.GetSpellingSuggestions(CustomDictionary, IgnoreUppercase,
MainDictionary, SuggestionMode, CustomDictionary2 CustomDictionary10)
Result: Returns a SpellingSuggestions collection that represents the words suggested as spelling replacements for the first word in the specified range.
Syntax 2
expression.GetSpellingSuggestions(Word, CustomDictionary, IgnoreUppercase,
MainDictionary, SuggestionMode, CustomDictionary2 CustomDictionary10)
Result:Returns a SpellingSuggestions collection that represents the words suggested as spelling replacements for a given word.
Note: If you use anything earlier than .NET4 then you'll have to use Missing.Value for the parameters you want empty/null
. As of .NET4
we've got optional parameters and when you add a reference to the Office Library, the interop wrapper will have overloads based on the optional parameters.