Compartilhar via


Bookmark.SpellingErrors Property

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

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

Syntax

'Declaration
ReadOnly Property SpellingErrors As ProofreadingErrors
ProofreadingErrors SpellingErrors { get; }

Property Value

Type: Microsoft.Office.Interop.Word.ProofreadingErrors
A ProofreadingErrors collection that represents the words identified as spelling errors in the Bookmark control.

Examples

The following code example adds a Bookmark control with text to the first paragraph and then runs the spell checker if there are spelling errors in the bookmark.

This example is for a document-level customization.

Private Sub BookmarkSpellingErrors()

    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")

    Bookmark1.Text = "This bookmark contains a spellling error." 

    If Bookmark1.SpellingErrors.Count > 0 Then
        Bookmark1.CheckSpelling(IgnoreUppercase:=True, _
            AlwaysSuggest:=True)
    End If 

End Sub
private void BookmarkSpellingErrors()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "This bookmark contains a spellling error.";

    object IgnoreUppercase = true;
    object AlwaysSuggest = true;
    if (bookmark1.SpellingErrors.Count > 0)
    {
        bookmark1.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

Bookmark Interface

Microsoft.Office.Tools.Word Namespace