Partager via


CommandBar.Top Property (Office)

Sets or gets the distance from the top edge of the specified command bar, to the top edge of the screen. For docked command bars, this property returns or sets the distance from the command bar to the top of the docking area. 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, search Help for the keyword "ribbon."

Syntax

expression .Top

expression Required. A variable that represents a CommandBar object.

Example

This example positions the upper-left corner of the floating command bar named "Custom" 140 pixels from the left edge of the screen and 100 pixels from the top of the screen.

Set myBar = CommandBars("Custom") 
myBar.Position = msoBarFloating 
With myBar 
    .Left = 140 
    .Top = 100 
End With

See Also

Concepts

CommandBar Object

CommandBar Object Members