Children 属性

       

返回一个 DiagramNodeChildren 对象,该对象包含指定图表顶点的所有子顶点。

expression.Children

expression   必需。该表达式返回一个 DiagramNode 对象。

示例

下列示例创建一个图表,并为其添加子顶点。

Sub CreatePyramidDiagram()
    Dim dgnNode As DiagramNode
    Dim shpDiagram As Shape
    Dim intCount As Integer

    'Add pyramid diagram to current document
    Set shpDiagram = ThisDocument.Shapes.AddDiagram( _
        Type:=msoDiagramPyramid, Left:=10, _
        Top:=15, Width:=400, Height:=475)

    'Add first child diagram node
    Set dgnNode = shpDiagram.DiagramNode.Children.AddNode

    'Add four more child nodes
    For intCount = 1 To 3
        dgnNode.AddNode
    Next intCount

End Sub