CheckSpelling Method

         Example         Applies To

Syntax 1: Checks the spelling of an object. This form has no return value; Microsoft Excel displays the Spelling dialog box.

Syntax 2: Checks the spelling of a single word. Returns True if the word is found in one of the dictionaries; returns False if the word isn’t found.

Syntax 1

expression.CheckSpelling(CustomDictionary, IgnoreUppercase, AlwaysSuggest, SpellLang)

Syntax 2

expression.CheckSpelling(Word, CustomDictionary, IgnoreUppercase)

expression   Required. An expression that returns an object in the Applies To list. Use the Application object to check a single word (Syntax 2).

CustomDictionary   Optional Variant. A string that indicates the file name of the custom dictionary to be examined if the word isn’t found in the main dictionary. If this argument is omitted, the currently specified dictionary is used.

IgnoreUppercase   Optional Variant. True to have Microsoft Excel ignore words that are all uppercase. False to have Microsoft Excel check words that are all uppercase. If this argument is omitted, the current setting will be used.

AlwaysSuggest   Optional Variant. True to have Microsoft Excel display a list of suggested alternate spellings when an incorrect spelling is found. False to have Microsoft Excel wait for you to input the correct spelling. If this argument is omitted, the current setting will be used.

Word   Required String (used only with Application object). The word you want to check.

SpellLang   Optional Variant. The language of the dictionary being used. Can be one of the MsoLanguageID values used by the LanguageID property.

Remarks

To check headers, footers, and objects on a worksheet, use this method on a Worksheet object.

To check only cells and notes, use this method with the object returned by the Cells method.