This is a migrated thread and some comments may be shown as answers.

SpellCheck on Code Behinde

1 Answer 55 Views
SpellChecker
This is a migrated thread and some comments may be shown as answers.
Sue Hills
Top achievements
Rank 1
Sue Hills asked on 13 Jun 2013, 02:07 PM
I would like to know if it is possible use spell check on word documents and take back a list of erroneous words.
I need to use these words one by one and replace them with a selected correct word on dictionary from outside of the silverlight control.
So I canot use the showSpellCheckDialog.....

For example: The user click on a button on html and the javascript will call a function on silverlight to bring the first incorrect word and the dictionay options for replacement. So when user select the correct word, the silverlight will do the replacement on many word documents
that are on a list.

1 Answer, 1 is accepted

Sort by
0
Andrew
Telerik team
answered on 18 Jun 2013, 01:48 PM
Hello Sue,

Here is some code that will allow you to get the next error word from a given position. Once you get it the code shows how to retrieve all suggestions. To use this approach you need to load the document in RadRichTextBox first.
DocumentSpellChecker documentSpellChecker = this.radRichTextBox.SpellChecker as DocumentSpellChecker;
            DocumentProofingManager documentProofingManager =
                new DocumentProofingManager(this.radRichTextBox.Document, documentSpellChecker, this.radRichTextBox.IgnoredWords);
 
            //here you can pass any document position you want. We pass the document position for convenience
            WordInfo wordInfo = documentProofingManager.GetNextErrorWord(this.radRichTextBox.Document.CaretPosition);
            if (wordInfo != null)
            {
                string nextErrorWord = wordInfo.Word;
                IEnumerable<string> suggestions = documentSpellChecker.GetSuggestions(nextErrorWord);
            }


Regards,
Andrew
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
SpellChecker
Asked by
Sue Hills
Top achievements
Rank 1
Answers by
Andrew
Telerik team
Share this question
or