raghuram.star
Board Regular
- Joined
- Sep 5, 2012
- Messages
- 102
Can you please help me find the Synonyms for a word in a given range
Like Each cell in Range A1:A5 has single word, in Range B1:B5 need to polulate Synonyms or Meaning of the word, like the option available in MS Word.
For example Cell A1 has word Organization which has following synonyms identified by default in MS Word
Organization = Group, Society, Institute, Association, Union, Business
Similarly I need to pick Max 3 Synonyms for any given word.
<colgroup><col><col></colgroup><tbody>
</tbody>
Below is the code I found to get Synonyms for a word in MS Word, but no luck in MS Excel yet.
Is there any equivalent vba code in MS Excel?
Please help
Like Each cell in Range A1:A5 has single word, in Range B1:B5 need to polulate Synonyms or Meaning of the word, like the option available in MS Word.
For example Cell A1 has word Organization which has following synonyms identified by default in MS Word
Organization = Group, Society, Institute, Association, Union, Business
Similarly I need to pick Max 3 Synonyms for any given word.
Word | Synonym |
Organization | Group, Society, Institute |
Motor | Engine, Motorized, Motor-powered |
Universe | Cosmos, World, Creation |
College | School, University, Academy |
Web | Mesh, Net, Netting |
<colgroup><col><col></colgroup><tbody>
</tbody>
Below is the code I found to get Synonyms for a word in MS Word, but no luck in MS Excel yet.
Code:
Sub GetSynonyms()
Dim msg As String
Dim var
Dim i As Long
Dim mySi As SynonymInfo
Dim synList() As String
Selection.Expand Unit:=wdWord
Set mySi = Selection.Range.SynonymInfo
For var = 1 To 1
synList = mySi.SynonymList(Meaning:=var)
For i = 1 To 3
iSynonyms = iSynonyms & synList(i) & ", "
Next i
Next
Debug.Print iSynonyms
End Sub
Is there any equivalent vba code in MS Excel?
Please help