Share via


Action.BeforeCaptionShow-Ereignis

Wird ausgelöst, nachdem der Benutzer auf das Smarttagsymbol geklickt hat und bevor das Smarttagmenü angezeigt wird.

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

Syntax

'Declaration
Event BeforeCaptionShow As BeforeCaptionShowEventHandler
event BeforeCaptionShowEventHandler BeforeCaptionShow

Hinweise

Durch dieses Ereignis haben Sie die Möglichkeit, die Smarttagbeschriftung auf Grundlage des Kontexts zu ändern.

Beispiele

Im folgenden Codebeispiel wird ein Handler für das BeforeCaptionShow-Ereignis veranschaulicht. Der Ereignishandler ändert die Menübeschriftung der Aktion. Dieses Codebeispiel ist Teil eines umfangreicheren Beispiels für die Action-Schnittstelle.

Dieses Beispiel bezieht sich auf eine Anpassung auf Dokumentebene.

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

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

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

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

.NET Framework-Sicherheit

Siehe auch

Referenz

Action Schnittstelle

Microsoft.Office.Tools.Excel-Namespace