Bookmark.SynonymInfo Property

 

Gets a SynonymInfo that contains information from the thesaurus on synonyms, antonyms, or related words and expressions for the text in the Bookmark control.

Namespace:   Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

SynonymInfo SynonymInfo { get; }

Property Value

Type: Microsoft.Office.Interop.Word.SynonymInfo

A SynonymInfo that contains information from the thesaurus on synonyms, antonyms, or related words and expressions for the text in the Bookmark control.

The following code example adds a Bookmark control with text to the document and then displays a message box if a synonym is found for the third word in the bookmark.

This example is for a document-level customization.

private void BookmarkSynonymInfo()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();

    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "This is sample bookmark text.";

    if(bookmark1.Words[3].SynonymInfo.Found)
    {
        MessageBox.Show("A synonym for " + bookmark1.Words[3].Text +
            "was found.");
    }	
}
Return to top
Show: