Udostępnij za pośrednictwem


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)

Syntax

'Declaration
Public ReadOnly Property SpellingErrors As ProofreadingErrors
    Get
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.

Examples

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 Sub DocumentSpellingErrors()
    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Me.Paragraphs(1).Range.Text = "This bookmark contains a spellling error."

    Dim IgnoreUppercase As Object = True
    Dim AlwaysSuggest As Object = True
    If Me.SpellingErrors.Count > 0 Then
        Me.CheckSpelling(, IgnoreUppercase, AlwaysSuggest)
    End If
End Sub 
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);
    }
}

.NET Framework Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace