返回或设置一个 MsoTriState 常量,该常量确定图表顶点和连接符的自动设置位置,可读写。
MsoTriState 可以是下列 MsoTriState 常量之一: |
msoCTrue 不用于该属性。 |
msoFalse 禁用自动版式设置。 |
msoTriStateMixed 不用于该属性。 |
msoTriStateToggle 不用于该属性。 |
msoTrue 自动设置图表中顶点和连接符的位置。 |
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