共用方式為


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)

Syntax

'Declaration
Property NoProofing As Integer
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.

Examples

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 Sub BookmarkNoProofing()

    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 mispellling."
    Bookmark1.InsertAfter(" This text also contains a mispelling.")
    Bookmark1.NoProofing = True 

    Me.CheckSpelling(IgnoreUppercase:=True, AlwaysSuggest:=True)

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

.NET Framework Security

See Also

Reference

Bookmark Interface

Microsoft.Office.Tools.Word Namespace