Share via


GroupShapes.GetEnumerator Method

Groups the shapes in the specified range. Returns the grouped shapes as a single CanvasShapes object.

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
Function GetEnumerator As IEnumerator
'Usage
Dim instance As GroupShapes
Dim returnValue As IEnumerator

returnValue = instance.GetEnumerator()
IEnumerator GetEnumerator()

Return Value

Type: System.Collections.IEnumerator
Shape

Implements

IEnumerable.GetEnumerator()

Remarks

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

Examples

This example adds two shapes to myDocument, groups the two new shapes, sets the fill for the group, rotates the group, and sends the group to the back of the drawing layer.

Set myDocument = ActivePresentation.Slides(1)

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

See Also

Reference

GroupShapes Interface

GroupShapes Members

GetEnumerator Overload

Microsoft.Office.Interop.PowerPoint Namespace