Bookmark.SpellingErrors Property

Definition

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

C#
public Microsoft.Office.Interop.Word.ProofreadingErrors SpellingErrors { get; }

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.

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

Applies to

Product Versions
Visual Studio Tools for Office 2017, 2019, 2022