Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Layout Property [Excel 2003 VBA Language Reference]

Office 2003

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 Required. An expression that returns one of the objects in the Applies To list.


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

    ' Change the layout to right-hanging.
    nodRoot.Layout = msoOrgChartLayoutRightHanging

End Sub

Applies to | DiagramNode Object

© 2015 Microsoft