主题
Item (方法)
从集合中返回一个对象。
说明
对象的文本名称就是 Name 属性的值。
参数
属性 | 数据类型 | 必填 | 说明 |
---|---|---|---|
Index | Any | 必填 | 对象的名称或索引号。 |
返回值
包含在集合中的一个 Shape 对象。
示例
python
#本示例对 Shapes 集合中第二个形状的 OnAction 属性进行设置。如果变量 ss 代表的不是 Shapes 对象,则本示例无效
def test():
ss = Application.Worksheets.Item(1).Shapes
ss.Item(2).OnAction = "ShapeAction"
python
#本示例将活动工作表中不包含图表的形状删除
def test():
shapes = ActiveSheet.Shapes
for i in range(1, shapes.Count):
if shapes.Item(i).HasChart:
shapes.Item(i).Delete()