Diagram Object

Microsoft PowerPoint Visual Basic

Diagram Object

         
Multiple objects Diagram
DiagramNodes

Represents a single diagram in a document. The Diagram object is a member of the DiagramNode and Shape objects and the ShapeRange collection.

Using the Diagram object

Use the Diagram property of the Shape object or ShapeRange collection to return a Diagram object.

Use the Convert method to change a diagram from one type to another. This example converts the first diagram on the first slide of the active presentation into a radial diagram. This example assumes that the first shape in the active presentation is a diagram and not another type of shape.

Sub DiagramConvert()
    ActivePresentation.Slides(1).Shapes(1).Diagram _
        .Convert Type:=msoDiagramRadial
End Sub

Use the Reverse property to flip the order of the nodes in a diagram, so that the first node becomes the last node, and vice versa. This example reverses the order of the diagram nodes for the second shape on the first slide of the active presentation . This assumes that the second shape in the active presentation is a diagram and not another type of shape.

Sub DiagramReverse()
    ActivePresentation.Slides(1).Shapes(2).Diagram.Reverse = msoTrue
End Sub

A DiagramNode object can have a nested Diagram object. Use the Diagram property of a DiagramNode object to return the nested Diagram object.