Share via


ActionEventArgs.Text, propriété

Obtient le texte qui a été reconnu comme une balise active.

Espace de noms :  Microsoft.Office.Tools.Word
Assembly :  Microsoft.Office.Tools.Word (dans Microsoft.Office.Tools.Word.dll)

Syntaxe

'Déclaration
ReadOnly Property Text As String
    Get
string Text { get; }

Valeur de propriété

Type : System.String
Texte qui a été reconnu comme une balise active.

Exemples

L'exemple de code suivant illustre un gestionnaire pour l'événement BeforeCaptionShow. Le gestionnaire d'événements utilise la propriété Text pour modifier la légende de menu de l'action. Cet exemple de code fait partie d'un exemple plus complet fourni pour l'interface Action.

Cet exemple illustre une personnalisation au niveau du document.

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;
    }
}

Sécurité .NET Framework

Voir aussi

Référence

ActionEventArgs Interface

Microsoft.Office.Tools.Word, espace de noms