CheckSpelling Method

Applies To

Application Object, Button Object, Buttons Collection, Chart Object, CheckBox Object, DialogFrame Object, DialogSheet Object, DrawingObjects Collection, GroupBox Object, GroupBoxes Collection, GroupObject Object, GroupObjects Collection, Label Object, Labels Collection, OptionButton Object, OptionButtons Collection, Range Object, TextBox Object, TextBoxes Collection, Worksheet Object.

Description

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, False if it is not.

Syntax 1

object.CheckSpelling(customDictionary, ignoreUppercase, alwaysSuggest)

Syntax 2

object.CheckSpelling(word, customDictionary, ignoreUppercase)

object

Required. The object to which this method applies. Use the Application object to check a single word (Syntax 2).

customDictionary

Optional. A string indicating the filename of the custom dictionary to examine if the word is not found in the main dictionary. If omitted, the currently specified dictionary is used.

ignoreUppercase

Optional. If True, Microsoft Excel will ignore words that are in all uppercase. If False, Microsoft Excel will check words that are in all uppercase. If omitted, the current setting will be used.

alwaysSuggest

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

word

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

Remarks

To check headers, footers, and objects, use Worksheet.CheckSpelling.

To check only cells and notes, use Worksheet.Cells.CheckSpelling.

Example

This example checks the spelling on Sheet1.


Worksheets("Sheet1").CheckSpelling