Compartilhar via


Range.GetSpellingSuggestions Method

Word Developer Reference

Returns a SpellingSuggestions collection that represents the words suggested as spelling replacements for the first word in the specified range.

Syntax

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

expression   Required. A variable that represents a Range object.

Parameters

Name Required/Optional Data Type Description
CustomDictionary Optional Variant Either an expression that returns a Dictionary object or the file name of the custom dictionary.
IgnoreUppercase Optional Variant True to ignore words in all uppercase letters. 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. If you don't specify a main dictionary, Microsoft Word uses the main dictionary that corresponds to the language formatting of the first word in the range.
SuggestionMode Optional Variant Specifies the way Word makes spelling suggestions. Can be one of the following WdSpellingWordType constants. The default value is wdSpellword.
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.

Return Value
SpellingSuggestions

Remarks

If the word is spelled correctly, the Count property of the SpellingSuggestions object returns 0 (zero).

Example

This example looks for the alternate spelling suggestions for the first word in the selected range. If there are suggestions, the example runs a spelling check on the selection.

Visual Basic for Applications
  If Selection.Range.GetSpellingSuggestions.Count = 0 Then
    Msgbox "No suggestions."
Else
    Selection.Range.CheckSpelling
End If

See Also