Selection.ChildShapeRange property (Publisher)

Returns a ShapeRange object representing the child shapes of a selection.

Syntax

expression.ChildShapeRange

expression A variable that represents a Selection object.

Return value

ShapeRange

Example

This example creates a new page in the active publication, populates the page with shapes, and selects and groups the shapes. After canceling the selection of two of the group shapes, it then changes the AutoShape type for one of the shapes.

Sub ChangeFillToChildShape() 
 
 With ThisDocument.Pages(1) 
 With .Shapes 
 .AddShape msoShape4pointStar, 10, 10, 175, 175 
 .AddShape msoShapeOval, 100, 100, 175, 75 
 .AddShape msoShapeOval, 150, 150, 175, 75 
 .Range.Group 
 .SelectAll 
 End With 
 .Shapes(1).GroupItems(1).Select msoFalse 
 .Shapes(1).GroupItems(2).Select msoFalse 
 End With 
 
 Selection.ChildShapeRange(3).AutoShapeType = msoShapeDiamond 
 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.