PDA

View Full Version : Code for Docking Toolbar



Marimojo
04-05-2005, 02:52 PM
We are using Word 2003 with some third-party applications. I am trying to get one toolbar to dock on the top left of the screen, the toolbar wants to dock on the right side of the screen - its a numbering toolbar made by Softwise - does anyone know the code to keep the command bar on the left side, 3rd row of toolbars??

Thank you.!
Marianne:hi:

Killian
04-05-2005, 05:48 PM
Hi Marianne :hi: Welcome to VBAX

This code will do what you want (you'll have to change the toolbar name). It runs fine if the row index is greater than the existing number of rows (it just puts it on the last one in that case). Note that the Menu bar (File, Edit, etc) is counted in the commandbars collectionSub test()

With Application.CommandBars("Custom 1")
.Position = msoBarTop
.Left = 0
.RowIndex = 3
End With

End Sub

MOS MASTER
04-06-2005, 02:02 PM
Hi, :D

Add this line to the with block of Killian and you can make shure it stay's there! :thumb
.Protection = msoBarNoMoveEnjoy!