全部显示

AutoLayout 属性

       

返回或设置一个 MsoTriState 常量,该常量确定图表顶点和连接符的自动设置位置,可读写。

expression.AutoLayout

expression   必需。该表达式返回一个 Diagram 对象。

示例

本示例在当前文档中创建一个图表,并自动设置顶点和连接符的位置。

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