Udostępnij za pośrednictwem


Bookmark.SpellingErrors Property (2007 System)

Gets a ProofreadingErrors collection that represents the words identified as spelling errors 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 ReadOnly Property SpellingErrors As ProofreadingErrors
'Usage
Dim instance As Bookmark 
Dim value As ProofreadingErrors 

value = instance.SpellingErrors
[BrowsableAttribute(false)]
public ProofreadingErrors SpellingErrors { get; }
[BrowsableAttribute(false)]
public:
property ProofreadingErrors^ SpellingErrors {
    ProofreadingErrors^ get ();
}
public function get SpellingErrors () : ProofreadingErrors

Property Value

Type: ProofreadingErrors
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.

Private Sub BookmarkSpellingErrors()

    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 spellling error." 

    If Bookmark1.SpellingErrors.Count > 0 Then
        Bookmark1.CheckSpelling(IgnoreUppercase:=True, _
            AlwaysSuggest:=True)
    End If 

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

.NET Framework Security

See Also

Reference

Bookmark Class

Bookmark Members

Microsoft.Office.Tools.Word Namespace