ToolsGetSynonyms, ToolsGetSynonyms()

Syntax

ToolsGetSynonyms FillArray$() [Word$] [MainDic$]

ToolsGetSynonyms(FillArray$() [Word$] [MainDic$])

Remarks

The ToolsGetSynonyms statement fills an array with synonyms for a word.

Argument

Explanation

FillArray$

The array — which must be defined before ToolsGetSynonyms is run — to fill with synonyms.

Word$

The word for which you want synonyms. 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.


The ToolsGetSynonyms() function returns the following values.

Value

Explanation

0 (zero)

If there are no synonyms available

–1

If one or more synonyms are available


Example

This example prompts the user for a word, and then displays up to five synonyms for that word in a message box:


word$ = InputBox$("Display synonyms for: ", "Get Synonyms")
Dim synonyms$(4)
ToolsGetSynonyms synonyms$(), word$
list$ = synonyms$(0)
For count = 1 To 4
    If synonyms$(count) <> "" Then
        list$ = list$ + ", " + synonyms$(count)
    End If
Next
MsgBox list$, "Synonyms for " + word$

See Also

ToolsGetSpelling