应用于 Shape 和 ShapeRange 对象的 Nodes 属性。
返回一个 ShapeNodes 集合,该集合代表指定形状的几何说明。应用于代表任意多边形绘图的 Shape 或 ShapeRange 对象。
expression.Nodes
expression 必选。该表达式返回上述对象之一。
以下示例返回新建图示中的节点数。
Sub ConvertPyramidDiagram()
Dim dgnNode As DiagramNode
Dim shpDiagram As Shape
Dim intNodes As Integer
'Create pyramid diagram and add 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
'Add three child nodes to the first node
For intNodes = 1 To 3
dgnNode.AddNode
Next intNodes
'Automatically layout diagram and convert to radial diagram
With dgnNode.Diagram
.AutoLayout = msoTrue
.Convert Type:=msoDiagramRadial
End With
'Display the number of nodes in the diagram
MsgBox dgnNode.Diagram.Nodes.Count
End Sub
本示例在 myDocument
中第三个形状的第四个结点后添加一个带有一段曲线的平滑结点。第三个形状必须是至少有四个结点的任意多边形。
Set myDocument = ActivePresentation.Slides(1)
With myDocument.Shapes(3).Nodes
.Insert Index:=4, SegmentType:=msoSegmentCurve, _
EditingType:=msoEditingSmooth, X1:=210, Y1:=100
End With