全部显示

Child 属性

       

如果该形状是子形状,或者如果形状范围内的所有形状都是同一个父形状的子形状,则属性值为 MsoTrue。只读。MsoTriState 类型。

expression.Child

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

示例

本示例选择了画布中的第一个形状,如果选定的形状是子形状,则用指定的颜色填充该形状。本示例假设当前演示文稿中的第一个形状是包含多个形状的绘图画布。

Sub FillChildShape()

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

    'Fill selected shape if it is a child shape
    With ActiveWindow.Selection

        If .ShapeRange.Child = msoTrue Then
            .ShapeRange.Fill.ForeColor.RGB = RGB(Red:=100, Green:=0, Blue:=200)
        Else
            MsgBox "This shape is not a child shape."
        End If

    End With

End Sub