Share via


Action.Click 事件

在智能标记菜单中的操作被单击时发生。 此类型或成员只适合在 2007 Microsoft Office system 项目中使用。Office 2010 中已弃用智能标记。
.

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

语法

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

.NET Framework 安全性

请参见

参考

Action 接口

Microsoft.Office.Tools.Excel 命名空间