Diagram Object

Microsoft Word Visual Basic

Diagram Object

         
DiagramNode Diagram
DiagramNodes

Represents a single diagram in a document. The Diagram object is a member of the Shapes collection.

Using the Diagram object

Use the Diagram property of the DiagramNode, Shape, and ShapeRange objects to return a single Diagram object. Use the Convert method to change a diagram from one type to another. This example converts the first diagram in the active document into a radial diagram. This example assumes that the first shape in the active document is a diagram and not another type of shape.

Sub DiagramConvert()
    ActiveDocument.Shapes(1).Diagram.Convert msoDiagramRadial
End Sub

Use the Reverse property to flip the order of the nodes in a diagram. This example reverses the order of the diagram nodes in the second shape in the active document. This assumes that the second shape in the active document is a diagram.

Sub DiagramReverse()
    ActiveDocument.Shapes(2).Diagram.Reverse = msoTrue
End Sub