ActionEventArgs.Properties 属性

获取已针对智能标记实现的所有属性。

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

语法

声明
ReadOnly Property Properties As ISmartTagProperties
    Get
ISmartTagProperties Properties { get; }

属性值

类型:Microsoft.Office.Interop.SmartTag.ISmartTagProperties
一个 Microsoft.Office.Interop.SmartTag.ISmartTagProperties 对象,该对象包含已针对智能标记实现的所有属性。

备注

Microsoft Office 智能标记软件开发工具包 (SDK) 中提供了 Microsoft.Office.Interop.SmartTag.ISmartTagProperties 接口。 若要在代码中使用此接口,请从**“添加引用”** 对话框的**“.NET”选项卡添加一个对“Microsoft.Office.Interop.SmartTag”**的引用。

示例

下面的代码示例演示 Click 事件的处理程序。 该事件处理程序使用 Properties 属性从智能标记属性的键控集合获取属性值。 此代码示例摘自为 SmartTag 接口提供的一个更大的示例。 此示例假设您已从**“添加引用”对话框的“.NET”选项卡中添加了一个对“Microsoft.Office.Interop.SmartTag”**的引用。

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

' This action displays the property value for the term.
Private Sub Action1_Click(ByVal sender As Object, _
    ByVal e As ActionEventArgs) Handles Action1.Click

    Dim propertyBag As ISmartTagProperties = e.Properties
    Dim key As String = "Key1"
    MsgBox("The corresponding value of " & _
        key & " is: " & propertyBag.Read(key))
End Sub
// This action displays the property value for the term.
private void Action1_Click(object sender, 
    Microsoft.Office.Tools.Word.ActionEventArgs e)
{
    ISmartTagProperties propertyBag = e.Properties;
    string key = "Key1";
    MessageBox.Show("The corresponding value of " + key + 
        " is: " + propertyBag.get_Read(key));
}

.NET Framework 安全性

请参见

参考

ActionEventArgs 接口

Microsoft.Office.Tools.Word 命名空间