返回或设置一个 MsoOrgChartLayoutType 常量,以表明组织结构图中的子顶点的格式。可读写。
MsoOrgChartLayoutType 可以是下列 MsoOrgChartLayoutType 常量之一: |
msoOrgChartLayoutAssistant 将子顶点作为辅助顶点来放置。 |
msoOrgChartLayoutBothHanging 将子顶点垂直置于左右两边的父顶点之下。 |
msoOrgChartLayoutLeftHanging 将子顶点垂直置于左边的父顶点之下。 |
msoOrgChartLayoutMixed 返回父顶点的值,该父顶点包含使用多个 MsoOrgChartLayoutType 常量设置格式的子顶点。 |
msoOrgChartLayoutRightHanging 将子顶点垂直置于右边的父顶点之下。 |
msoOrgChartLayoutStandard 将子顶点水平置于父顶点之下。 |
expression.Layout
expression 必需。该表达式返回一个 DiagramNode 对象。
本示例在活动文档中创建一个组织结构图,该组织结构图有三个子顶点,并且垂直置于右边的父顶点之下。
Sub OrgChartLayoutHangRight()
Dim shpOrgChart As Shape
Dim dgnRoot As DiagramNode
Dim dgnManagerShape As DiagramNode
Dim intCount As Integer
'Add an org chart to the active document and
'add the first (parent) node
Set shpOrgChart = ActiveDocument.Shapes.AddDiagram( _
Type:=msoDiagramOrgChart, Left:=10, _
Top:=15, Width:=400, Height:=475)
Set dgnRoot = shpOrgChart.DiagramNode.Children.AddNode
'Add three child nodes to the parent node
For intCount = 1 To 3
dgnRoot.Children.AddNode
Next
'Format the child nodes to hang vertically along the
'right directly under the parent node.
dgnRoot.Layout = msoOrgChartLayoutRightHanging
End Sub