Hi
Using help of Word VBA, I have been able to deploy the following code that is giving me the list of synonymns of my selected word. However, since there are more than 5000 lines in my document, I need to make a loop which could check each line and put the meanings of that word if available, otherwise put "----" if the word in not found in cutom dictionary.
So I need help from you guys to make such loop. Please help. I am more than half way done with script and your little help will give it a final go.
Sub MakeSynonyms()
Set mySyn = Selection.Words(1).SynonymInfo
If mySyn.MeaningCount <> 0 Then
myList = mySyn.MeaningList
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=" ("
For i = 1 To UBound(myList)
Selection.TypeText Text:=myList(i) & " ,"
Next i
Selection.TypeText Text:=")"
Else
Selection.EndKey Unit:=wdLine
Selection.TypeText Text:=" ----"
End If
End Sub
Genius is 99% perspiration and 1% inspiration
|