DocumentBase.SpellingErrors Property

 

Gets a ProofreadingErrors collection that represents the words identified as spelling errors in the document.

Namespace:   Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

public ProofreadingErrors SpellingErrors { get; }

Property Value

Type: Microsoft.Office.Interop.Word.ProofreadingErrors

A ProofreadingErrors collection that represents the words identified as spelling errors in the document.

The following code example inserts a misspelled word in the document and then checks the spelling of all the words in the document. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentSpellingErrors()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    this.Paragraphs[1].Range.Text = "This bookmark contains a spellling error.";

    object IgnoreUppercase = true;
    object AlwaysSuggest = true;
    if (this.SpellingErrors.Count > 0)
    {
        this.CheckSpelling(ref missing, ref IgnoreUppercase, ref AlwaysSuggest,
            ref missing, ref missing, ref missing, ref missing,
            ref missing, ref missing, ref missing, ref missing,
            ref missing);
    }
}
Return to top
Show: