Bookmark.NoProofing Property
Visual Studio 2012
Gets or set a value that indicates whether the spelling and grammar checker ignores the text in the Bookmark control.
Assembly: Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)
Property Value
Type: Int320 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); }
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.