本示例在组合对象中判断所选的形状中是否包含子形状,如果是则将该子形状的边框线条设为红色,否则设为蓝色。

With ActiveWindow.Selection
    If .HasChildShapeRange = True Then
        .ChildShapeRange.Line.ForeColor.RGB = RGB(200, 15, 10)
    Else
        .ShapeRange.Line.ForeColor.RGB = RGB(10, 15, 200)
    End If
End With