全部显示

Layout 属性

       

返回或设置一个 MsoOrgChartLayoutType 常量,以表明组织结构图中的子顶点的格式。可读写。

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