Position Property

Applies To

CommandBar object.

Description

Returns or sets the position of the specified command bar. Can be one of the following MsoBarPosition constants: msoBarLeft, msoBarTop, msoBarRight, msoBarBottom, msoBarFloating, msoBarPopup, or msoBarMenu. Read/write Long.

Specifics (Microsoft Access)

You can't set the Position property to the intrinsic constant msoBarPopup. To create a shortcut menu, use the Position argument of the Add method of the CommandBars collection.

The msoBarMenuBar constant is used only with the Macintosh.

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