CommandBar.RowIndex property (Office)
Gets or sets the docking order of a command bar in relation to other command bars in the same docking area. Can be an integer greater than zero, or either of the following msoBarRow constants: msoBarRowFirst or msoBarRowLast. 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.RowIndex
expression A variable that represents a CommandBar object.
Remarks
Several command bars can share the same row index, and command bars with lower numbers are docked first. If two or more command bars share the same row index, the command bar most recently assigned will be displayed first in its group.
Example
This example adjusts the position of the command bar named Custom by moving it to the left 110 pixels more than the default, and it makes this command bar the first to be docked by changing its row index to msoBarRowFirst.
Set myBar = CommandBars("Custom")
With myBar
.RowIndex = msoBarRowFirst
.Left = 140
End With
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.