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)

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.

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);
    }
}
Return to top
Show: