Udostępnij za pośrednictwem


Bookmark.NoProofing Property (2007 System)

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.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public Property NoProofing As Integer
'Usage
Dim instance As Bookmark 
Dim value As Integer 

value = instance.NoProofing

instance.NoProofing = value
[BrowsableAttribute(false)]
public int NoProofing { get; set; }
[BrowsableAttribute(false)]
public:
property int NoProofing {
    int get ();
    void set (int value);
}
public function get NoProofing () : int 
public function set NoProofing (value : int)

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 Class

Bookmark Members

Microsoft.Office.Tools.Word Namespace