GroupShapes 对象 (PowerPoint)GroupShapes object (PowerPoint)

代表组合形状中的单个形状。Represents the individual shapes within a grouped shape. 每个形状都由一个**shape** 对象表示。Each shape is represented by a Shape object. 通过将Item方法与此对象结合使用, 您可以使用组合中的单个形状, 而无需对其进行取消组合操作。Using the Itemmethod with this object, you can work with single shapes within a group without having to ungroup them.

示例Example

使用GroupItems属性返回GroupShapes集合。Use the GroupItemsproperty to return the GroupShapes collection. 使用 GroupItems (索引),其中索引是在组合形状中的单个形状的数目,从 GroupShapes 集合中返回一个形状。Use GroupItems (index), where index is the number of the individual shape within the grouped shape, to return a single shape from the GroupShapes collection. 下例向 myDocument 添加三个三角形,将它们分成一组,设置整个组的颜色,然后只更改第二个三角形的颜色。The following example adds three triangles to myDocument, groups them, sets a color for the entire group, and then changes the color for the second triangle only.

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

另请参阅See also

PowerPoint 对象模型引用PowerPoint Object Model Reference

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.