Remarks

Each shape is represented by a object. Using the method with this object, you can work with single shapes within a group without having to ungroup them.

Example

Use the property to return the GroupShapes collection. Use (), where is the number of the individual shape within the grouped shape, to return a single shape from the the GroupShapescollection. 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.

Visual Basic for Applications
Set myDocument = Worksheets(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
group shapes Group Shapes Collection Object GroupShape Collection groupshape collection object

See also:

index index