Bookmark.SpellingErrors Property

Definition

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

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

Applies to