Share via


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
Aa201141.parchild(en-us,office.10).gifDiagramNodes
Aa201141.space(en-us,office.10).gifAa201141.parchild(en-us,office.10).gifDiagramNode

A collection of DiagramNode objects that represents all the nodes in a diagram.

Using the DiagramNodes collection

Use the Nodes property of the Diagram object to return a DiagramNodes collection. Use the Item method to select and work with a single diagram node in a diagram.  This example assumes the first shape on the first slide in the active presentation is a diagram, selects the first node, and deletes it.

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

Use the SelectAll method to select and work with all nodes in a diagram.  This example assumes the first shape on the first slide in the active presentation is a diagram, selects all nodes, and fills them with the specified pattern.

  Sub FillDiagramNodes()
    ActivePresentation.Slides(1).Shapes(1).Diagram.Nodes.SelectAll
    ActiveWindow.Selection.ShapeRange.Fill.Patterned _
        Pattern:=msoPatternSmallConfetti
End Sub