全部显示

AddNode 方法

       

应用于 DiagramNodeChildren 对象的 AddNode 方法。

应用于 DiagramNode 对象的 AddNode 方法。

示例

本示例向活动工作表中的图表节点添加一个节点。

Sub DiagramNodeOBJ()

        Dim nodDiagNode As DiagramNode
        Dim shDiagram As Shape

        Set shDiagram = ActiveSheet.Shapes.AddDiagram _
            (Type:=msoDiagramOrgChart, _
            Left:=10, _
            Top:=15, _
            Width:=400, _
            Height:=475)

        Set nodDiagNode = shDiagram.DiagramNode

        'Add a root node to the diagram.
        nodDiagNode.Children.AddNode

End Sub