CommandBar Size


Posted by Jeremy Benson on July 27, 2001 9:27 AM

I am creating a floating command bar and it is wider than the screen. How can I set it up so that it displays more than one row of icons?



Posted by Ivan F Moala on July 28, 2001 3:45 AM

Jeremy....have a look @ online help
Commandbars / Height eg.

Height Property Example

This example adds a custom control to the command bar named "Custom". The example sets the height of the custom control to twice the height of the command bar and sets the control’s width to 50 pixels. Notice how the command bar automatically resizes itself to accommodate the control.

Set myBar = CommandBars("Custom")
barHeight = myBar.Height
Set myControl = myBar.Controls _
.Add(Type:=msoControlButton, _
Id:= CommandBars("Standard").Controls("Save").Id, _
Temporary:=True)
With myControl
.Height = barHeight * 2
.Width = 50
End With
myBar.Visible = True

Ivan