Поделиться через


Bookmark.CheckSpelling Method

Begins a spelling check for the document from the start of the Bookmark control to the end of the document.

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

Syntax

'Declaration
Sub CheckSpelling ( _
    ByRef CustomDictionary As Object, _
    ByRef IgnoreUppercase As Object, _
    ByRef AlwaysSuggest As Object, _
    ByRef CustomDictionary2 As Object, _
    ByRef CustomDictionary3 As Object, _
    ByRef CustomDictionary4 As Object, _
    ByRef CustomDictionary5 As Object, _
    ByRef CustomDictionary6 As Object, _
    ByRef CustomDictionary7 As Object, _
    ByRef CustomDictionary8 As Object, _
    ByRef CustomDictionary9 As Object, _
    ByRef CustomDictionary10 As Object _
)
void CheckSpelling(
    ref Object CustomDictionary,
    ref Object IgnoreUppercase,
    ref Object AlwaysSuggest,
    ref Object CustomDictionary2,
    ref Object CustomDictionary3,
    ref Object CustomDictionary4,
    ref Object CustomDictionary5,
    ref Object CustomDictionary6,
    ref Object CustomDictionary7,
    ref Object CustomDictionary8,
    ref Object CustomDictionary9,
    ref Object CustomDictionary10
)

Parameters

  • CustomDictionary
    Type: System.Object%
    Either an expression that returns a Dictionary or the file name of the custom dictionary.
  • IgnoreUppercase
    Type: System.Object%
    true if capitalization is ignored. If this argument is omitted, the current value of the IgnoreUppercase property is used.
  • AlwaysSuggest
    Type: System.Object%
    true for Microsoft Office Word to always suggest alternative spellings. If this argument is omitted, the current value of the SuggestSpellingCorrections property is used.
  • CustomDictionary2
    Type: System.Object%
    Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
  • CustomDictionary3
    Type: System.Object%
    Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
  • CustomDictionary4
    Type: System.Object%
    Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
  • CustomDictionary5
    Type: System.Object%
    Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
  • CustomDictionary6
    Type: System.Object%
    Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
  • CustomDictionary7
    Type: System.Object%
    Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
  • CustomDictionary8
    Type: System.Object%
    Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
  • CustomDictionary9
    Type: System.Object%
    Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.
  • CustomDictionary10
    Type: System.Object%
    Either an expression that returns a Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.

Remarks

If the Bookmark control contains errors, this method displays the Spelling and Grammar dialog box, with the Check grammar check box cleared.

Optional Parameters

For information on optional parameters, see Optional Parameters in Office Solutions.

Examples

The following code example adds a Bookmark control with text to the document and then checks the spelling of the text in the document, from the start of the bookmark to the end of the document.

This example is for a document-level customization.

Private Sub BookmarkCheckSpelling()

    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")
    Dim IgnoreUppercase As Object = True
    Dim AlwaysSuggest As Object = True

    Bookmark1.Text = "This bookmark contains a mispellling"
    Bookmark1.CheckSpelling(IgnoreUppercase:=IgnoreUppercase, _
        AlwaysSuggest:=AlwaysSuggest)

End Sub
private void BookmarkCheckSpelling()
{
    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 mispellling";

    object IgnoreUppercase = true;
    object AlwaysSuggest = true;
    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 Interface

Microsoft.Office.Tools.Word Namespace