Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Top position of the toolbar 2

Status
Not open for further replies.

peljo

Technical User
Mar 3, 2006
91
BG
I use the following code to create a toolbar:
Sub BuildCustomToolbar()
Dim oCmdBar As CommandBar
On Error Resume Next
'point to custom toolbar
Set oCmdBar = CommandBars("MyToolbar")
'if it doesn't exist create it
If Err <> 0 Then
Set oCmdBar = CommandBars.Add("MyToolbar")
Err = 0
With oCmdBar
'now add a control
..etc..etc

However the toolbar is placed in the middle of the screen.And i want it on the top of the screen, but i do not know the command.I tried with the following line :
Position:=msotop
But obvisouly this i sno the right code.
Could someone help me ?
 
Have you tried this ?
With oCmdBar
.Position = msoBarTop
'now add a control
..etc..etc

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top