如果指定的图形是子图形,或者图形区域中的所有图形都是同一个父图形的子图形,就返回 msoTrue。MsoTriState 类型,只读。
MsoTriState 可为以下 MsoTriState 常量之一。 |
msoCTrue 不应用于本属性。 |
如果选择的图形不是子图形,则为 msoFalse。 |
如果只有一些选定图形是子图形,则为 msoTriStateMixed。 |
msoTriStateToggle 不应用于本属性。 |
如果选定图形是子图形,则为 msoTrue。 |
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