CommandBar.Position property (Office)

Gets or sets an msoBarPosition constant representing the position of a command bar. Read/write.

Note

The use of CommandBars in some Microsoft Office applications has been superseded by the new ribbon component of the Microsoft Office Fluent user interface. For more information, see Overview of the Office Fluent ribbon.

Syntax

expression.Position

expression A variable that represents a CommandBar object.

Example

This example steps through the collection of command bars, docking the custom command bars at the bottom of the application window and docking the built-in command bars at the top of the window.

For Each bar In CommandBars 
    If bar.Visible = True Then 
        If bar.BuiltIn Then 
            bar.Position = msoBarTop 
         Else 
            bar.Position = msoBarBottom 
        End If 
    End If 
Next

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.