CustomProperty 对象

         
CustomProperties
CustomProperty

代表标识符信息。标识符信息可用于 XML 的元数据。

CustomProperty 对象用法

可用 Add 方法或 CustomProperties 集合的 Item 属性返回一个 CustomProperty 对象。

返回一个 CustomProperty 对象后,可使用 Add 方法的 CustomProperties 属性向工作表中添加元数据。

下例示范了该功能。本示例中,Microsoft Excel 向活动工作表中添加标识符信息,并将名称和值返回给用户。

Sub CheckCustomProperties()

    Dim wksSheet1 As Worksheet

    Set wksSheet1 = Application.ActiveSheet

    ' Add metadata to worksheet.
    wksSheet1.CustomProperties.Add _
        Name:="Market", Value:="Nasdaq"

    ' Display metadata.
    With wksSheet1.CustomProperties.Item(1)
        MsgBox .Name & vbTab & .Value
    End With

End Sub