应用于 DiagramNodeChildren 对象的 AddNode 方法。
将一个 DiagramNode 对象添加到子图表顶点的集合。
expression.AddNode(Index)
expression 必需。该表达式返回一个 DiagramNodeChildren 对象。
Index Variant 类型,可选。添加新图表顶点的索引位置:如果该参数为 0,则添加在所有顶点之前,如果该参数为 -1,则添加在所有顶点之后,若为其他 Index 数值,则添加在集合中相应的顶点之后。
应用于 DiagramNode 对象的 AddNode 方法。
创建一个图表顶点,返回代表新图表顶点的 DiagramNode 对象。对于概念图表,将 DiagramNode 对象添加到图形列表的末尾。
expression.AddNode(Pos)
expression 必需。该表达式返回一个 DiagramNode 对象。
Pos MsoRelativeNodePosition,可选。指定要添加的相对于引出点的顶点位置。
MsoRelativeNodePosition 可以是下列 MsoRelativeNodePosition 常量之一: |
msoAfterLastSibling |
msoAfterNode default |
msoBeforeFirstSibling |
msoBeforeNode |
本示例在当前文档中添加棱锥图表,并将三个顶点添加到图表。
Sub CreatePyramidDiagram()
Dim dgnNode As DiagramNode
Dim shpDiagram As Shape
Dim intCount As Integer
'Add pyramid diagram to the current document
Set shpDiagram = ThisDocument.Shapes.AddDiagram _
(Type:=msoDiagramPyramid, Left:=10, _
Top:=15, Width:=400, Height:=475)
'Add first diagram node child to the pyramid diagram
Set dgnNode = shpDiagram.DiagramNode.Children.AddNode
'Add three more diagram node children to the pyramid diagram
For intCount = 1 To 3
dgnNode.AddNode
Next intCount
End Sub