-3

Im trying to use Synonyms in my program. I added the Ref to Word's Interop. Unfortunately, when I try to look for get_SynonymInfo function, I do not have that one in my options.

Does anyone know what the problem is?

Mattias
  • 3,907
  • 4
  • 28
  • 50
michal_h
  • 51
  • 7

1 Answers1

-1

Try this example:

Add using:

using Microsoft.Office.Interop.Word;

Add the following code to a method:

var word = new Microsoft.Office.Interop.Word.Application();
string simpleWord = "hello";
SynonymInfo s = word.SynonymInfo[simpleWord];
foreach (var meaning in s.MeaningList as Array)
{
     MessageBox.Show((string)meaning);
}

You should get "ciao" as output

ehh
  • 3,412
  • 7
  • 43
  • 91
  • Second, I get an exception while running: "An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in SearchEngineInterface.exe Additional information: Word cannot start the thesaurus." Do u know y? – michal_h Jan 12 '16 at 15:09
  • You may need to install dictionary in your Microsoft office – ehh Jan 12 '16 at 15:19