Shape.Child 屬性 (Word)

True 是表示 如果圖案是子圖案或圖案範圍中的所有圖案是相同的父項之子圖案。 唯讀 MsoTriState 。

語法

運算式。子女

需要 expression。 代表 Shape 物件的變數。

範例

在這個範例中,會選取畫布上的第一個圖案,並且如果選取的圖案是子圖案,就會用指定的色彩填滿圖案。 本範例會假設使用中文件的第一個圖案是含有多個圖案的繪圖畫布。

Sub FillChildShape() 
 
 Dim shpCanvasItem As Shape 
 
 'Select the first shape in the drawing canvas 
 Set shpCanvasItem = ActiveDocument.Shapes(1).CanvasItems(1) 
 
 'Fill selected shape if it is a child shape 
 With shpCanvasItem 
 If .Child = msoTrue Then 
 .Fill.ForeColor.RGB = RGB(100, 0, 200) 
 Else 
 MsgBox "This shape is not a child shape." 
 End If 
 End With 
 
End Sub

另請參閱

Shape 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。