Word.Tips.Net WordTips (Menu Interface)

Locking the Position of Custom Toolbars

If you have developed custom toolbars in Word, you may have noticed a problem with them. Do they "move around," meaning that they are in different places every time you start Word? If this is the case, you may be wondering how to make the toolbars stay put, exactly where you want them to be.

The first thing to understand is that positioning information for toolbars is maintained by Word in the HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Data Registry key. (Actually, the 9.0 portion of the key changes, depending on your version. This is for Word 2000. If you are using Word 97, it is 8.0, and it is 10.0 for Word 2002.)

Whenever you exit Word, the toolbar positions are written into the Registry. Because of this, you can try these steps to permanently position the toolbars:

  1. Directly open the Normal.dot template, or the template in which the toolbars are located. (Make sure you open the template itself, not a document based on the template.)
  2. In the template, type a character; any character will do. This lets Word know that you have "changed" the template, so it knows you need to save it.
  3. Position the toolbars where you want them located, by default.
  4. Delete the character you added in step 2.
  5. Close Word, saving any changes to the template.

The next time you start Word, the toolbars should be where you want them to be. If they aren't, you may want to exit Word and try deleting the \Word\Data Registry key, as described earlier in this tip. When you next start Word, the Registry key is automatically created, and you can again try positioning the toolbars.

Another approach is to use a macro to lock the position of your toolbars. Add the following macro to the Document New event of the template itself.

Sub LockAllVisibleToolbars()
    Dim cb As CommandBar

    For Each cb In CommandBars
        If cb.Visible = True Then
            cb.Protection = msoBarNoChangeDock + _ 
              msoBarNoChangeVisible + _ 
              msoBarNoCustomize + _
              msoBarNoMove + _
        End If
    Next cb
End Sub

It is, of course, run each time a new document is created based on the template. The macro locks the position of the toolbars and does not allow them to be moved or customized. You can unlock the toolbars by running this macro:

Sub UnlockAllVisibleToolbars()
    Dim cb As CommandBar

    For Each cb In CommandBars
        If cb.Visible = True Then
            If cb.Name = ("Task Pane") Then
                cb.Protection = msoBarNoCustomize
                cb.Protection = msoBarNoProtection
            End If
        End If
    Next cb
End Sub

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1354) applies to Microsoft Word 97, 2000, 2002, and 2003.

Related Tips:

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!


Leave your own comment:

  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*What is 5+3 (To prevent automated submissions and spam.)
           Commenting Terms

Comments for this tip:

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us


Advertise with Us

Our Privacy Policy

Our Sites


Beauty and Style




DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)



Home Improvement

Money and Finances


Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Our Products

Helpful E-books

Newsletter Archives


Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2016 Sharon Parq Associates, Inc.