ActionEventArgs.Text Property

Gets the text that was recognized as a smart tag.

Smart tags are deprecated in Excel 2010 and Word 2010. You can still use the related APIs, but there is no smart tag functionality after Excel 2007 and Word 2007.

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

Syntax

'Declaration
ReadOnly Property Text As String
string Text { get; }

Property Value

Type: System.String
The text that was recognized as a smart tag.

Examples

The following code example demonstrates a handler for the BeforeCaptionShow event. The event handler uses the Text property to modify the menu caption of the action. This code example is part of a larger example provided for the Action interface.

This example is for a document-level customization.

Private Sub DisplayAddress_BeforeCaptionShow(ByVal sender As Object, _
    ByVal e As Microsoft.Office.Tools.Word.ActionEventArgs) _
    Handles displayAddress.BeforeCaptionShow

    Dim clickedAction As Microsoft.Office.Tools.Word.Action = _
        TryCast(sender, Microsoft.Office.Tools.Word.Action)

    If clickedAction IsNot Nothing Then
        clickedAction.Caption = "Display the location of " & e.Text
    End If
End Sub
void displayAddress_BeforeCaptionShow(object sender,
    Microsoft.Office.Tools.Word.ActionEventArgs e)
{
    Microsoft.Office.Tools.Word.Action clickedAction =
        sender as Microsoft.Office.Tools.Word.Action;

    if (clickedAction != null)
    {
        clickedAction.Caption = "Display the location of " +
            e.Text;
    }
}

.NET Framework Security

See Also

Reference

ActionEventArgs Interface

Microsoft.Office.Tools.Word Namespace