CheckSpelling Method

Microsoft Word Visual Basic

Show All

CheckSpelling Method

       

CheckSpelling method as it applies to the Application and Global objects.

Checks a string for spelling errors. Returns a Boolean to indicate whether the string contains spelling errors. True if the string has no spelling errors.

expression.CheckSpelling(Word, CustomDictionary, IgnoreUppercase, MainDictionary, CustomDictionary2, CustomDictionary3, CustomDictionary4, CustomDictionary5, CustomDictionary6, CustomDictionary7, CustomDictionary8, CustomDictionary9, CustomDictionary10)

expression   Required. An expression that returns an Application or Global object.

Word  Required String. The text whose spelling is to be checked.

CustomDictionary  Optional Variant. Either an expression that returns a Dictionary object or the file name of the custom dictionary.

IgnoreUppercase  Optional Variant. True if capitalization is ignored. If this argument is omitted, the current value of the IgnoreUppercase property is used.

MainDictionary  Optional Variant. Either an expression that returns a Dictionary object or the file name of the main dictionary.

CustomDictionary2 – CustomDictionary10   Optional Variant. Either an expression that returns a Dictionary object or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.

CheckSpelling method as it applies to the Document and Range objects.

Begins a spelling check for the specified document or range. If the document or range contains errors, this method displays the Spelling and Grammar dialog box (Tools menu), with the Check grammar check box cleared. For a document, this method checks all available stories (such as headers, footers, and text boxes).

expression.CheckSpelling(CustomDictionary, IgnoreUppercase, AlwaysSuggest, CustomDictionary2, CustomDictionary3, CustomDictionary4, CustomDictionary5, CustomDictionary6, CustomDictionary7, CustomDictionary8, CustomDictionary9, CustomDictionary10)

expression   Required. An expression that returns a Document or Range object.

CustomDictionary  Optional Variant. Either an expression that returns a Dictionary object or the file name of the custom dictionary.

IgnoreUppercase  Optional Variant. True if capitalization is ignored. If this argument is omitted, the current value of the IgnoreUppercase property is used.

AlwaysSuggest  Optional Variant. True for Microsoft Word to always suggest alternative spellings. If this argument is omitted, the current value of the SuggestSpellingCorrections property is used.

CustomDictionary2 – CustomDictionary10   Optional Variant. Either an expression that returns a Dictionary object or the file name of an additional custom dictionary. You can specify as many as nine additional dictionaries.

Example

As it applies to the Range object.

This example begins a spelling check on all available stories of the active document.

Set range2 = Documents("MyDocument.doc").Sections(2).Range
range2.CheckSpelling IgnoreUpperCase:=False, _
    CustomDictionary:="MyWork.Dic", _
    CustomDictionary2:="MyTechnical.Dic"