设置或返回一个 MsoTriState 常量,该常量指定图表的自动格式设置状况,可读写。
MsoTriState 可以是下列 MsoTriState 常量之一: |
msoCTrue 不用于该属性。 |
msoFalse 禁用自动格式设置。 |
msoTriStateMixed 不用于该属性。 |
msoTriStateToggle 不用于该属性。 |
msoTrue 将图表设为自动设置格式。 |
expression.AutoFormat
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 formatting for the diagram and convert
'it to a radial diagram
With dgnNode.Diagram
.AutoFormat = msoTrue
.Convert Type:=msoDiagramRadial
End With
End Sub