AutoLayout Property

Microsoft Word Visual Basic

constant that determines the automatic positioning of the nodes and connectors in a diagram. Read/write.

MsoTriState can be one of these MsoTriState constants.
msoCTrue Not used for this property.
msoFalse Disables automatic layout.
msoTriStateMixed Not used for this property.
msoTriStateToggle Not used for this property.
msoTrue Automatically positions nodes and connectors in a diagram.

expression.AutoLayout

expression    Required. An expression that returns a Diagram object.

Example

This example creates a diagram in the current document and automatically positions the nodes and connectors.

Sub CreatePyramidDiagram()
    Dim dgnNode As DiagramNode
    Dim shpDiagram As Shape
    Dim intCount As Integer

    'Add a pyramid diagram to current document and first child node
    Set shpDiagram = ThisDocument.Shapes.AddDiagram( _
        Type:=msoDiagramPyramid, Left:=10, _
        Top:=15, Width:=400, Height:=475)
    Set dgnNode = shpDiagram.DiagramNode.Children.AddNode

    'Add three child node
    For intCount = 1 To 3
        dgnNode.AddNode
    Next intCount

    'Enable automatic positioning of the diagram nodes
    'and convert diagram to a radial diagram
    With dgnNode.Diagram
        .AutoLayout = msoTrue
        .Convert Type:=msoDiagramRadial
    End With

End Sub