GroupShapes 对象 (PowerPoint)

代表组合形状中的单个形状。 每个形状表示 形状 对象。 使用 项目 方法与此对象,您可以使用组合中的单个形状而不必取消组合。

示例

使用 GroupItems 属性可返回 GroupShapes 集合。 使用 GroupItems (索引) ,其中 index 是分组形状中单个形状的编号,可从 GroupShapes 集合返回单个形状。 下例向 myDocument 添加三个三角形,将它们分成一组,设置整个组的颜色,然后只更改第二个三角形的颜色。

Set myDocument = ActivePresentation.Slides(1)

With myDocument.Shapes
    .AddShape(msoShapeIsoscelesTriangle, 10, _
        10, 100, 100).Name = "shpOne"

    .AddShape(msoShapeIsoscelesTriangle, 150, _
        10, 100, 100).Name = "shpTwo"

    .AddShape(msoShapeIsoscelesTriangle, 300, _
        10, 100, 100).Name = "shpThree"

    With .Range(Array("shpOne", "shpTwo", "shpThree")).Group
        .Fill.PresetTextured msoTextureBlueTissuePaper
        .GroupItems(2).Fill.PresetTextured msoTextureGreenMarble
    End With
End With

另请参阅

PowerPoint 对象模型引用

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。