返回一个 DiagramNode 对象,该对象代表图表中的一个顶点。只读。
expression.DiagramNode
expression 必需。该表达式返回“应用于”列表中的一个对象。
本示例将一个棱锥图表添加到当前文档。
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 diagram node child
Set dgnNode = shpDiagram.DiagramNode.Children.AddNode
'Add three more diagram child nodes
For intCount = 1 To 3
dgnNode.AddNode
Next intCount
End Sub