Using Thesaurus RRS feed

  • Question

  • I was wanting to use the Thesaurus to determine if two words are similar for my word add-in.  How do I do this?
    Tuesday, October 18, 2011 4:00 PM

All replies

  • Hi cwang733t,

    There is Thesaurus function under Review item which suggests other words with the similar meaning to the word you have selected.

    By the way, below link describes how to use MS Word object model to get synonyms and antonyms lists in VB.NET. Hope it could make you get some ideas. 

    If you have any concerns, please feel free to follow up.

    Have a nice day.

    Best regards

    Liliane Teng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, October 19, 2011 4:05 AM
  • That has taking me to the correct direction, but I am using 2010 and it seems to want to autocast the thing for me.

    Word.SynonymInfo info = Globals.AutoproseAddin.Application.SynonymInfo["death", Word.WdLanguageID.wdEnglishUS];
    if (info.Found && info.MeaningCount > 0)
        var meanings = (Array)info.MeaningList;

    This simple line throws this exception:

    Unable to cast object of type 'System.String[*]' to type 'System.String[]'.

    Any ideas how to keep it from trying to cast it to a 0 based array.  I have tried an array and copying it over manually with array.copy and starting it at index 1, but still not luck.  I also tried a straight assignment to another System.String[*] and not luck.  Help please!

    Array a = Array.CreateInstance(typeof(string), new int[]{0}, new int[]{1});


    Wednesday, October 19, 2011 2:25 PM