Layout Property

Microsoft Excel Visual Basic

Show All

Layout Property

       

Returns or sets an MsoOrgChartLayoutType constant to indicate the formatting of the child nodes of an organization chart. Read/write.

MsoOrgChartLayoutType can be one of these MsoOrgChartLayoutType constants.
msoOrgChartLayoutAssistant  Places child nodes as assistants.
msoOrgChartLayoutBothHanging  Places child nodes vertically from the parent node on both the left and the right side.
msoOrgChartLayoutLeftHanging  Places child nodes vertically from the parent node on the left side.
msoOrgChartLayoutMixed  Return value for a parent node that has children formatted using more than one MsoOrgChartLayoutType.
msoOrgChartLayoutRightHanging  Places child nodes vertically from the parent node on the right side.
msoOrgChartLayoutStandard  Places child nodes horizontally below the parent node.

expression.Layout

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

In this example, an organization chart's layout is modified to display as right-hanging instead of standard.

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