DiagramNodes Collection

DiagramNodes Collection
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Diagram
Aa192438.parchild(en-us,office.10).gifDiagramNodes
Aa192438.space(en-us,office.10).gifAa192438.parchild(en-us,office.10).gifDiagramNode

A collection of DiagramNode objects that represent all the nodes in a diagram. The DiagramNodes collection contains all the diagram nodes in a specified diagram.

Using the DiagramNodes collection

Use the Nodes property to return the DiagramNodes collection. Use the SelectAll method to select and work with all nodes in a diagram. This example selects all nodes in the specified diagram and fills them with the specified pattern. The following example assumes the first shape in the active document is a diagram.

  Sub FillDiagramNodes()
    ActiveDocument.Shapes(1).Diagram.Nodes.SelectAll
    Selection.ShapeRange.Fill.Patterned msoPatternSmallConfetti
End Sub

Use the Item method to select and work with a single diagram node in a diagram. This example selects the first node in the specified diagram and deletes it. The following example assumes the first shape in the active document is a diagram.

  Sub FillDiagramNode()
    ActiveDocument.Shapes(1).Diagram.Nodes.Item(1).Delete
End Sub