Skip to content
本页内容

Select (方法)

选择对象。

参数

属性数据类型必填说明
ReplaceAny可选(仅用于工作表)。如果为 True,则用指定的对象替换当前所选内容。如果为 False,则扩展当前所选内容以包括以前选择的对象和指定的对象。

示例

python
#本示例选中第一张工作表中的所有平行四边形
def test():
    shapes = Application.Worksheets.Item(1).Shapes
    for i in range(1, shapes.Count):
        if shapes.Item(i).AutoShapeType == msoShapeParallelogram:
            shapes.Item(i).Select(False)
python
#本示例将活动工作表的第一个和第三个形状选中
def test():
    shapes = ActiveSheet.Shapes
    shapes.Item(1).Select()
    shapes.Item(3).Select(False)