ToolsGetSpelling, ToolsGetSpelling()

Syntax

ToolsGetSpelling FillArray$() [Word$] [MainDic$] [SuppDic$] [Mode]

ToolsGetSpelling(FillArray$() [Word$] [MainDic$] [SuppDic$] [Mode])

Remarks

The ToolsGetSpelling statement fills an array with the words suggested as replacements for a misspelled word. Suggestions are assigned to elements of the array in the order they appear in the spelling checker.

Argument

Explanation

FillArray$

The array — which must be defined before ToolsGetSpelling is run — to fill with suggested replacements.

Word$

The word for which you want suggested replacements. If Word$ is omitted, Word uses the word closest to the insertion point.

MainDic$

A text string that represents the language name for the main dictionary in the specified language. For a list of valid foreign language names, see ToolsLanguage. If you specify neither a
word nor a main dictionary, Word uses the main dictionary that corresponds to the language formatting of the word closest to the insertion point.

SuppDic$

A path and filename for a custom dictionary (for example, "C:\WINWORD\USER1.DIC" (Windows) or "HD:WORD:MY TERMS" (Macintosh)). If Word$ is found in the custom dictionary, ToolsGetSpelling puts no words in the array. If .SuggestFromMainDictOnly (ToolsOptionsSpelling statement)
is 0 (zero), suggested replacements are retrieved from the custom dictionary as well as the main dictionary. Note that anagrams are retrieved from the main dictionary only.

Mode

Specifies how Word makes suggestions for Word$:

0 or omitted Returns suggested correct spellings for Word$.

1 Returns suggested replacements that match the search criteria when Word$ contains the question mark (?) and asterisk (*) wildcard characters.

2 Returns anagrams for Word$ (words composed of the same letters as Word$). Word does not return anagrams from a custom dictionary. Note that this functionality may not be available if you are using a spelling checker other than the one shipped with Word.


The ToolsGetSpelling() function returns the number of replacements suggested by the spelling checker. If the word is spelled correctly, 0 (zero) is returned.

Example

This example checks the spelling of the word "kolor," and then displays up to five suggested replacements in a series of message boxes:


Dim suggest$(4)
ToolsGetSpelling suggest$(), "kolor"
For count = 0 To 4
    If suggest$(count) <> "" Then MsgBox suggest$(count)
Next

See Also

ToolsGetSynonyms, ToolsLanguage, ToolsOptionsSpelling