Any way to list the misspelled words?

2 posts, 1 answers
  1. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 05 Mar 2012 Link to this post

    Is there anything on the document that will list the misspelled words.  I'm basically going to give a warning message, saying you have these misspelled words, do you wish to continue.  I'm doing it like below which works fine, but I'm just wondering if there is already a list in the document.

    UPDATE:  This code below fails on words that are considered names like 'Microsoft' with an uppercase M.  It won't find it in the dictionary, but it doesn't show a red under because the M is capitalized.  Any way I can ignore those?  Or would the rule be just ignore everything that starts with a capital.

    string a = new TxtFormatProvider().Export(rrtbDescription.Document);
    string[] allwords = a.Split(' ');
    List<string> misspelled = new List<string>();
    foreach (var z in allwords)
        if (this.rrtbDescription.SpellChecker.CheckWordIsCorrect(z) == false)
  2. Answer
    Boby avatar
    586 posts

    Posted 09 Mar 2012 Link to this post

    Hello Dan,
    You can use the DocumentProofingManager instead:
    RadDocument document = (RadDocument)this.radRichTextBox.Document.CreateDeepCopy();
    DocumentProofingManager proofingManager = new DocumentProofingManager(document, this.radRichTextBox.SpellChecker, this.radRichTextBox.IgnoredWords);
    var incorrectWordsList = proofingManager.GetIncorrectWordList();
    Creating a copy of the document is needed because otherwise RadRichTextBox spell checker marks the spans as spellchecked and proofing manager skips them.

    Don't hesitate to contact us if you have other questions.

    All the best,
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft R3 2016 release webinar banner
Back to Top