如果图形是子图形或位于图形区域的所有图形都是同一父图形的子图形,则该属性值为
True。
MsoTriState 类型,只读。
语法
表达式.Child
表达式 必选。一个代表 Shape 对象的变量。
示例
本示例选择绘图画布中的第一个图形,并且如果所选图形是一个子图形,用指定颜色填充图形。本示例假定活动文档中的第一个图形是包含多个图形的绘图画布。
示例代码 |
function FillChildShape(){
//Select the first shape in the drawing canvas
let shpCanvasItem = ActiveDocument.Shapes.Item(1).CanvasItems.Item(1)
//Fill selected shape if it is a child shape
if(shpCanvasItem.Child == msoTrue){
shpCanvasItem.Fill.ForeColor.RGB = 100, 0, 200
}
else {
MsgBox("This shape is not a child shape.")
}
}
|