Skip to content
本页内容

Item (方法)

从集合中返回一个对象。

参数

属性数据类型必填说明
IndexAny必填对象的名称或索引号。

示例

python
# 下例演示了该功能。在此示例中,ET 向活动工作表添加标识符信息,并向用户返回名称和值
def test():

    wksSheet1 = Application.ActiveSheet

    # Add metadata to worksheet.
    wksSheet1.CustomProperties.Add("Market", "Nasdaq")

    # Display metadata.
    cusProperties = wksSheet1.CustomProperties.Item(1)
        print(cusProperties.Name + "\t" + cusProperties.Value)