Dehanny25 Posted May 24, 2008 Posted May 24, 2008 I wrote a spell checker function, however I could not adjust its language. Although it has an adjustment part : object objLanguage = Word.WdLanguageID.wdEnglishUS; , it is not working. I live in Turkey and it works Turkish. Can you help me ? Thanks a lot. public string[] Suggest2(string word) { object nothing = Missing.Value; object objLanguage = Word.WdLanguageID.wdEnglishUS; //ask MS Word to spell check the given word bool spelledright = this.application.CheckSpelling( word, ref nothing, ref nothing, ref (object)objLanguage, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing ); if (spelledright) return null; //if word is spelled wrong, ask MS Word to suggest //other similar words. ArrayList words = new ArrayList(); SpellingSuggestions suggestions = this.application.GetSpellingSuggestions( word, ref nothing, ref nothing, ref (object)objLanguage, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing ); //add the suggestions to an ArrayList temporarily foreach (SpellingSuggestion suggestion in suggestions) words.Add(suggestion.Name); suggestions = null; //return the suggestions as a string array return (string[])words.ToArray(typeof(string)); } Quote
Administrators PlausiblyDamp Posted May 24, 2008 Administrators Posted May 24, 2008 Do you have the relevant dictionaries installed? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Dehanny25 Posted May 24, 2008 Author Posted May 24, 2008 Yes, the dictionaries are installed in Office 2003 - Word and in the project (Visual Studio) "Add Reference" is done for the Microsoft Word 11.0 Object Library. However, when I send some words to the function it checks for Turkish spelling and suggests Turkish words(I live in Turkey). I want it to check and suggest in English.. Quote
Recommended Posts