Document.SpellingErrors Property (2007 System)

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.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property SpellingErrors As ProofreadingErrors
'Usage
Dim instance As Document 
Dim value As ProofreadingErrors 

value = instance.SpellingErrors
[BrowsableAttribute(false)]
public ProofreadingErrors SpellingErrors { get; }
[BrowsableAttribute(false)]
public:
property ProofreadingErrors^ SpellingErrors {
    ProofreadingErrors^ get ();
}
public function get SpellingErrors () : ProofreadingErrors

Property Value

Type: 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.

This example is for a document-level customization.

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

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace