Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DocumentBase.CheckSpelling Method

Begins a spelling check for the document.

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

public 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 T:Microsoft.Office.Interop.Word.Dictionary or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.

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

This method checks all available stories (such as headers, footers, and text boxes).

Optional Parameters

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

The following code example uses the CheckSpelling method to check the spelling of words in the document. While checking, Word ignores capitalization and suggests alternate spellings. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentCheckSpelling()
{
    object ignoreUppercase = true;
    object alwaysSuggest = true;

    // Add a sentence with mispellings to the document. 
    object start = 0;
    object end = 0;
    string newText = "Allways check your speling. ";
    Word.Range range1 = this.Range(ref start, ref end);
    range1.Text = newText;

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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft