返回或设置一个 MsoOrgChartLayoutType 常量,该常量指示组织结构图的子节点的格式设置。可读写。
| MsoOrgChartLayoutType 可为以下 MsoOrgChartLayoutType 常量之一。 |
| msoOrgChartLayoutAssistant 将子节点作为辅助节点。 |
| msoOrgChartLayoutBothHanging 将子节点垂直放置在父节点的左边和右边。 |
| msoOrgChartLayoutLeftHanging 将子节点垂直放置在父节点的左边。 |
| msoOrgChartLayoutMixed 返回具有子节点的父节点的值,其中,使用了多个 MsoOrgChartLayoutType 对子节点进行格式设置。 |
| msoOrgChartLayoutRightHanging 将子节点垂直放置在父节点的右边。 |
| msoOrgChartLayoutStandard 将子节点水平放置在父节点的下边。 |
expression.Layout
expression 必需。该表达式返回“应用于”列表中的对象之一。
在本示例中,将组织结构图的版式修改为右缩进,而不是标准形式。
Sub Layout()
Dim nodRoot As DiagramNode
Dim shDiagram As Shape
Dim intCount As Integer
Set shDiagram = ActiveSheet.Shapes.AddDiagram( _
Type:=msoDiagramOrgChart, Top:=10, _
Left:=15, Width:=400, Height:=475)
Set nodRoot = shDiagram.DiagramNode.Children.AddNode
' Add three mode nodes.
For intCount = 1 To 3
nodRoot.Children.AddNode
Next
' Change the layout to right-hanging.
nodRoot.Layout = msoOrgChartLayoutRightHanging
End Sub