For my specific problem, can someone explain what I can do to get similar results in MS Excel as MS Word when getting synonyms for a particular word?
Issue: The following code for the word "onboard" results in a memory error, which is essentially the Set mySynInfo = SynonymInfo(Word:=myWord, LanguageID:=wdEnglishUS) code erroring out. If I change it to "on-board" it works. In contrast, if you enter the word in a MS Word Doc and right click the word, you get a return of synonyms. It seems that somehow, they are either separating the word in to two words, or hyphenating them.
Code
Sub SelectWord()
Dim mObjWord As Word.Application
Dim mySynInfo As Word.SynonymInfo
Dim myWord As String
Set mObjWord = CreateObject("Word.Application")
myWord = "onboard"
Set mySynInfo = SynonymInfo(Word:=myWord, LanguageID:=wdEnglishUS)
Debug.Print Join(mySynInfo.SynonymList(1), ", ")
Debug.Print Join(mySynInfo.MeaningList(), ", ")
Set mObjWord = Nothing
Set mySynInfo = Nothing
End Sub
Display More
Thanks