Priority Property

Microsoft Office Object Model

Show All

Priority Property

       

Returns or sets the priority of a command bar control. A control's priority determines whether the control can be dropped from a docked command bar if the command bar controls can't fit in a single row. Read/write Long.

Remarks

Valid priority numbers are 0 (zero) through 7. A priority of 1 means that the control cannot be deleted from a toolbar. Other priority values are ignored.

The Priority property is not used by command bar controls that are menu items.

Example

This example moves a control and assigns it a priority of 5 so that it will likely be dropped from the command bar if the controls don't all fit in one row.

Set allcontrols = CommandBars("Custom").Controls
For Each ctrl In allControls
    If ctrl.Type = msoControlComboBox Then
        With ctrl
            .Move Before:=7
            .Tag = "Selection box"
            .Priority = 5
        End With
    Exit For
End If
Next