Consulting

Results 1 to 3 of 3

Thread: Code for Docking Toolbar

  1. #1
    VBAX Newbie
    Joined
    Apr 2005
    Posts
    1
    Location

    Code for Docking Toolbar

    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

  2. #2
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    Hi Marianne 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 collection[VBA]Sub test()

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

    End Sub[/VBA]
    K :-)

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi,

    Add this line to the with block of Killian and you can make shure it stay's there!
    .Protection = msoBarNoMove
    Enjoy!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •