全部显示

Layout 属性

       

返回或设置一个 MsoOrgChartLayoutType 常量,该常量指示组织结构图的子节点的格式设置。可读写。

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