全部显示

AddNode 方法

       

应用于 DiagramNodeChildren 对象的 AddNode 方法。

应用于 DiagramNode 对象的 AddNode 方法。

示例

下面示例将节点添加到一个新建的图示中。

Sub CreatePyramidDiagram()

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

    'Adds the pyramid diagram and first 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 more nodes to pyramid diagram
    For intNodes = 1 To 3
        dgnNode.AddNode
    Next intNodes

End Sub