Expand Minimize

Bookmark.NoProofing Property

Gets or set a value that indicates whether the spelling and grammar checker ignores the text in the Bookmark control.

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

int NoProofing { get; set; }

Property Value

Type: System.Int32
0 if the spelling and grammar checker does not ignore the text in the Bookmark control; 1 if the spelling and grammar checker ignores the text in the Bookmark control; wdUndefined if the spelling and grammar checker ignores only some of the text in the Bookmark control.

The following code example adds a Bookmark control with misspelled text to the first paragraph, and sets the NoProofing property of the bookmark to true. When the document is checked for spelling errors, the misspelled text within the bookmark is ignored.

This example is for a document-level customization.

private void BookmarkNoProofing()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();

    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    int WordTrue = 1;
    bookmark1.Text = "This bookmark contains a mispellling.";
    bookmark1.InsertAfter(" This text also contains a mispelling.");
    bookmark1.NoProofing = WordTrue;

    object IgnoreUppercase = true;
    object AlwaysSuggest = true;

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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft