Shape.Child プロパティ (Word)

True の場合は、図形が子図形または図形範囲のすべての図形がある場合は同じ親の子図形です。 読み取り専用 msotristate クラス です。

構文

expression 必須です。 Shape オブジェクトを表す変数を指定します。

次の使用例は、キャンバスの図形 1 を選択し、選択した図形が子図形である場合は、指定した色でその図形を塗りつぶします。 この使用例は、作業中の文書の最初の図形が、複数の図形を含む描画キャンバスであることを前提としています。

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 のサポートおよびフィードバックを参照してください。