Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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));

}

Posted
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..
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...