更新:2007 年 11 月
获取已针对智能标记实现的所有属性。
命名空间: Microsoft.Office.Tools.Excel
程序集: Microsoft.Office.Tools.Excel.v9.0(在 Microsoft.Office.Tools.Excel.v9.0.dll 中)
语法
声明
Public ReadOnly Property Properties As ISmartTagProperties
用法
Dim instance As ActionEventArgs
Dim value As ISmartTagProperties
value = instance.Properties
public ISmartTagProperties Properties { get; }
属性值
类型:ISmartTagProperties
已针对智能标记实现的所有属性。
备注
Microsoft Office 2003 智能标记软件开发工具包 (SDK) 中提供了 ISmartTagProperties 接口。若要在代码中使用此接口,请从“添加引用”对话框的“COM”选项卡添加一个对“Microsoft Smart Tags 2.0 类型库”的引用。
示例
下面的代码示例演示 Click 事件的处理程序。该事件处理程序使用 Properties 属性从智能标记属性的键控集合获取属性值。此代码示例摘自为 SmartTag 类提供的一个更大示例。此示例假设您已从“添加引用”对话框的“COM”选项卡添加一个对“Microsoft Smart Tags 2.0 类型库”的引用。
此示例针对的是文档级自定义项。
' 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, ActionEventArgs e)
{
ISmartTagProperties propertyBag = e.Properties;
string key = "Key1";
MessageBox.Show("The corresponding value of " + key +
" is: " + propertyBag.get_Read(key));
}
权限
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。