ShapeRange.Group (Word)

Groups the shapes in the specified range, and returns the grouped shapes as a single Shape object.

Because a group of shapes is treated as a single shape, grouping and ungrouping shapes changes the number of items in the Shapes collection and changes the index numbers of items that come after the affected items in the collection.


Set myDocument = ActiveDocument 
With myDocument.Shapes 
 .AddShape(msoShapeCan, 50, 10, 100, 200).Name = "shpOne" 
 .AddShape(msoShapeCube, 150, 250, 100, 200).Name = "shpTwo" 
 With .Range(Array("shpOne", "shpTwo")).Group 
 .Fill.PresetTextured msoTextureBlueTissuePaper 
 .Rotation = 45 
 .ZOrder msoSendToBack 
 End With 
End With