Megosztás a következőn keresztül:


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)

Syntax

'Declaration
ReadOnly Property SynonymInfo As SynonymInfo
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.

Examples

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 Sub BookmarkSynonymInfo()

    Me.Paragraphs(1).Range.InsertParagraphBefore()

    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")
    Bookmark1.Text = "This is sample bookmark text." 

    If bookmark1.Words(3).SynonymInfo.Found Then
        MessageBox.Show("A synonym for " & Bookmark1.Words(3).Text _
            & "was found.")
    End If 

End Sub
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.");
    }   
}

.NET Framework Security

See Also

Reference

Bookmark Interface

Microsoft.Office.Tools.Word Namespace