This documentation is archived and is not being maintained.

ParentGroupShape Property


This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Returns a Shape object that represents the common parent shape of a child shape or a range of child shapes.

expression.ParentGroupShape

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

This example creates two shapes in the active document and groups those shapes. Then using one shape in the group, it accesses the parent group and fills all shapes in the parent group with the same fill pattern. This example assumes that the active document does not currently contain any shapes. If it does, an error may occur.

Sub ParentGroupShape()
    Dim shpGroup As Shape

    With ActiveDocument.Pages(1).Shapes
        .AddShape Type:=msoShapeOval, Left:=72, _
            Top:=72, Width:=100, Height:=100
        .AddShape Type:=msoShapeHeart, Left:=110, _
            Top:=120, Width:=100, Height:=100
        .Range(Array(1, 2)).Group
    End With

    Set shpGroup = ActiveDocument.Pages(1).Shapes(1) _
        .GroupItems(1).ParentGroupShape
    shpGroup.Fill.Patterned Pattern:=msoPattern25Percent

End Sub
Show: