Children 属性

       

返回 DiagramNodeChildren 对象,该对象代表指定图示节点的所有子节点。

expression.Children

expression 必选。该表达式返回“应用于”列表中的对象之一。

示例

以下示例创建了一个棱锥图并向该图示添加子节点。

Sub CreatePyramidDiagram()

    Dim dgnNode As DiagramNode
    Dim shpDiagram As Shape
    Dim intNodes As Integer

    'Adds pyramid diagram and first child node
    Set shpDiagram = ActivePresentation.Slides(1).Shapes _
        .AddDiagram(Type:=msoDiagramPyramid, Left:=10, _
        Top:=15, Width:=400, Height:=475)
    Set dgnNode = shpDiagram.DiagramNode.Children.AddNode

    'Adds three additional child nodes to diagram
    For intNodes = 1 To 3
        dgnNode.AddNode
    Next intNodes

End Sub