Freigeben über


DocumentBase.SpellingErrors Property

Definition

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

public:
 property Microsoft::Office::Interop::Word::ProofreadingErrors ^ SpellingErrors { Microsoft::Office::Interop::Word::ProofreadingErrors ^ get(); };
public Microsoft.Office.Interop.Word.ProofreadingErrors SpellingErrors { get; }
member this.SpellingErrors : Microsoft.Office.Interop.Word.ProofreadingErrors
Public ReadOnly Property SpellingErrors As ProofreadingErrors

Property Value

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

Applies to