I want all synonyms with a list inside a text box in a user form for a word from a paragraph. But it shows one by one with the msgbox.
Code:
Private Sub CommandButton1_Click()
Dim mySynObj As Object
Dim SList As Variant
Dim i As Variant
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend
Set mySynObj = Selection.Range.SynonymInfo
SList = mySynObj.SynonymList(1)
For i = 1 To UBound(SList)
MsgBox "A synonym for " & mySynObj.Word _
& " is " & SList(i)
Next i
End Sub