Action.Click 事件 (2007 system)

更新:2007 年 11 月

在智能标记菜单中的操作被单击时发生。

命名空间:  Microsoft.Office.Tools.Excel
程序集:  Microsoft.Office.Tools.Excel.v9.0(在 Microsoft.Office.Tools.Excel.v9.0.dll 中)

语法

声明
Public Event Click As ActionClickEventHandler
用法
Dim instance As Action
Dim handler As ActionClickEventHandler

AddHandler instance.Click, handler
public event ActionClickEventHandler Click

示例

下面的代码示例演示 Click 事件的处理程序。该事件处理程序显示包含所识别的智能标记术语或表达式的单元格的地址。此代码示例摘自为 Action 类提供的一个更大示例。

此示例针对的是文档级自定义项。

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(missing,
        missing, Excel.XlReferenceStyle.xlA1, missing, missing);
    System.Windows.Forms.MessageBox.Show("The recognized text '" + e.Text +
        "' is at range " + smartTagAddress);
}

权限

另请参见

参考

Action 类

Action 成员

Microsoft.Office.Tools.Excel 命名空间