Skip to content
本页内容

SelectAll (方法)

选择指定的 Shapes 集合中的所有形状。

示例

python
#本示例选择第一张工作表中的所有形状,并创建包含所有这些形状的 ShapeRange 集合
def test():
    shapes = Application.Worksheets.Item(1).Shapes
    shapes.SelectAll()
    sr = Application.Selection.ShapeRange
python
#本示例将活动工作表的所有形状的边框粗细设置为 8 磅,颜色为红色
def test():
    shapes = ActiveSheet.Shapes
    shapes.SelectAll()
    Selection.ShapeRange.Line.Weight = 8
    Selection.ShapeRange.Line.ForeColor.RGB = RGB(255, 0, 0)