返回图表顶点集合中的下一个 DiagramNode 对象。
expression.NextNode
expression 必需。该表达式返回“应用于”列表中的一个对象。
使用 PrevNode 方法返回图表顶点集合中上一个 DiagramNode 对象。
本示例创建一个组织结构图,并为中图表顶点添加一个子顶点。
Sub AddChildrenToMiddle()
Dim dgnRoot As DiagramNode
Dim shpDiagram As Shape
Dim dgnNext As DiagramNode
Dim intCount As Integer
'Add organization chart to current document
Set shpDiagram = ThisDocument.Shapes.AddDiagram _
(Type:=msoDiagramOrgChart, Left:=10, _
Top:=15, Width:=400, Height:=475)
'Add four child nodes to organization chart
Set dgnRoot = shpDiagram.DiagramNode.Children.AddNode
For intCount = 1 To 3
dgnRoot.Children.AddNode
Next
'Access the node immediately following the
'first diagram node and add three child nodes
Set dgnNext = dgnRoot.Children.Item(1).NextNode
For intCount = 1 To 3
dgnNext.Children.AddNode
Next intCount
End Sub