Shape.ParentGroup (Word)

Renvoie un objet Shape qui représente la forme parente commune d’une forme enfant ou d’une plage de formes enfants.


Sub ParentGroupShape() 
 Dim pgShape As Shape 
 
 'Add two shapes to active document and group 
 With ActiveDocument.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 pgShape = ActiveDocument.Shapes(1) _ 
 .GroupItems(1).ParentGroup 
 pgShape.Fill.ForeColor.RGB = RGB(Red:=100, Green:=0, Blue:=255) 
 
End Sub