全部显示

Child 属性

       

如果指定的图形是子图形,或者图形区域中的所有图形都是同一个父图形的子图形,就返回 msoTrueMsoTriState 类型,只读。

expression.Child

expression   必需。该表达式返回“应用于”列表中的对象之一。

示例

本示例选择画布中的第一个图形,并且如果选择的图形是子图形,则用指定的颜色填充该图形。本示例假定活动工作表上的一个绘图画布中包含多个图形。

Sub FillChildShape()

    'Select the first shape in the drawing canvas
    ActiveSheet.Shapes(1).CanvasItems(1).Select

    'Fill selected shape if it is a child shape
    If Selection.ShapeRange.Child = msoTrue Then
        Selection.ShapeRange.Fill.ForeColor.RGB = RGB(100, 0, 200)
    Else
        MsgBox "This shape is not a child shape."
    End If

End Sub