GroupShapes Interface
Represents the individual shapes within a grouped shape. Each shape is represented by a CanvasShapes object. Using the Item[Object] method with this object, you can work with single shapes within a group without having to ungroup them.
Namespace: Microsoft.Office.Interop.PowerPoint
Assembly: Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)
Syntax
'Declaration
<GuidAttribute("9149347B-5A91-11CF-8700-00AA0060263B")> _
Public Interface GroupShapes _
Inherits IEnumerable
'Usage
Dim instance As GroupShapes
[GuidAttribute("9149347B-5A91-11CF-8700-00AA0060263B")]
public interface GroupShapes : IEnumerable
Examples
Use the GroupItems property to return the GroupShapes collection. 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. 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