Partager via


ActionClickEventHandler Delegate

Represents the method that will handle the Click event of an Action.

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

Syntax

'Declaration
Public Delegate Sub ActionClickEventHandler ( _
    sender As Object, _
    e As ActionEventArgs _
)
public delegate void ActionClickEventHandler(
    Object sender,
    ActionEventArgs e
)

Parameters

Remarks

When you create an ActionClickEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate.

Examples

The following code example demonstrates a handler for the Click event. The event handler displays the address of the cell that contains the recognized smart tag term or expression. 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_Click(ByVal sender As Object, _
    ByVal e As Microsoft.Office.Tools.Excel.ActionEventArgs) _
    Handles DisplayAddress.Click

    Dim smartTagAddress As String = e.Range.Address( _
        ReferenceStyle:=Excel.XlReferenceStyle.xlA1)
    MsgBox("The recognized text '" & e.Text & _
            "' is at range " & smartTagAddress)
End Sub
void DisplayAddress_Click(object sender, 
    Microsoft.Office.Tools.Excel.ActionEventArgs e)
{
    string smartTagAddress = e.Range.get_Address(Excel.XlReferenceStyle.xlA1);
    System.Windows.Forms.MessageBox.Show("The recognized text '" + e.Text +
        "' is at range " + smartTagAddress);
}

See Also

Reference

Microsoft.Office.Tools.Excel Namespace