The menu bar and toolbars that are built into Word 2003 and earlier versions offer quick functionality. Click this, choose that, and the job's done. When building custom Word templates and applications, you can build custom toolbars that offer project-specific commands for the same ease of use. Follow these steps to add a custom toolbar to a Word template or document to increase user efficiency and satisfaction.
Note: This article is also available as a PDF download.
1: Determine needs
The first step to building a custom toolbar is to determine what tasks users will want to execute from it. A document or template's purpose will define those needs, but there are a few tips that will apply to almost all situations:
- One toolbar can do the job of many. Instead of adding a custom toolbar, consider altering the built-in toolbar by adding the needed functionality. More toolbars aren't necessarily a good thing.
- Use custom toolbars as an interface to custom tasks. For instance, you might add a custom toolbar that applies custom styles in a specialized template.
- Use custom toolbars to categorize custom tasks. In a large application with many tasks, you might want to add several custom toolbars, each executing related tasks. Then, display each custom toolbar as needed.
- By adding only the tools a user needs to a custom toolbar, you can limit choices and eliminate errors generated by inappropriate requests.
In general, the first tip is the most important. Just because you can add custom toolbars doesn't mean you should. Too many toolbars will create clutter, present too many options, and confuse users. Create a custom toolbar that provides the functionality necessary to get the job done and no more. You can always add more toolbars (and commands) as needs arise.
2: Open the Customize dialog boxYou'll perform almost all of the customization in the Customize dialog box, shown in Figure A. While this dialog box is open, Word suspends normal activity. Specifically, the active toolbars and menu bar are in edit mode. Clicking an icon or menu in this mode, allows you to alter it in some way, without executing its task as clicking it normally would.
Use the Customize dialog box to create custom toolbars and alter existing ones.
There's more than one way to open the Customize dialog box:
- From the Tools menu, choose Customize.
- OR right-click the background of the menu bar or any toolbar and choose Customize from the resulting submenu.
- OR choose Toolbars from the View menu and then select Customize from the resulting submenu.
With the Customize dialog box open, go ahead and click a few toolbar buttons or try to access a menu. You can't because those objects are in edit mode.
3: Generate and name the new toolbarThe next step is to actually generate a new toolbar. With the Customize dialog box open, click the Toolbars tab and then click the New button. In the New Toolbar dialog box, shown in Figure B, give the new toolbar a name and identify the document (or template) to which the toolbar belongs. If you add the toolbar to Normal.dot, it will be available to every new document you create. Click OK to generate the new toolbar, shown in Figure C. At this point, it's just an empty shell. In addition, the toolbar appears at the bottom of the Toolbars list on the Toolbars tab.
Give the custom toolbar a meaningful name.
This custom toolbar doesn't contain any buttons or menus yet.
4: Choose a built-in commandNow you're ready to start adding commands to your toolbar. To replicate a built-in command, click the Commands tab in the Customize dialog box. The Categories list represents the built-in menus and existing tools. Select Styles and Word updates the Commands list, as shown in Figure D.
Add a predefined style to the custom toolbar.
5: Add a built-in commandAfter finding the built-in command, you're ready to add it to the toolbar. From the Commands list, drag Normal to the custom toolbar. Figure E shows the insertion cursor as you hover over the toolbar.
Drag a command to the toolbar.Release the command to add it to the toolbar. Repeat this process to add Balloon Text to the toolbar. Figure F shows the custom toolbar with two styles: Normal and Balloon Text. Don't click Close just yet.
This toolbar will allow users to quickly assign these two styles to text.
6: Add a built-in menu
You're not limited to specific commands; you can add an entire menu. That's especially convenient when you're building a custom toolbar as a primary interface. That way, you can offer some familiarity and functionality, while still limiting access. For instance, you might want users to have access to the options on the Edit menu. To add this built-in menu to the toolbar, do the following:
- Click Built-in Menus in the Categories list (on the Commands tab in the Customize dialog box).
- Drag Edit to the custom toolbar and release it. There really isn't room, but don't worry. Simply position the insertion point at the border as shown in Figure G, and Word will make room for it.
Drop a built-in menu onto the custom toolbar.As you can see in Figure H, the Edit menu in the custom toolbar works just like the built-in Edit menu on the menu bar.
You can add a complete menu system.
7: Add a custom command
Adding built-in commands and menus affords you a lot of flexibility when creating special templates for your users. However, the real power lies in giving users the opportunity to execute custom but automated tasks. The short route is to use a custom tool to execute a macro as follows:
- Choose Macros from the Categories list, and Word will update the Commands list to the left. Figure I shows the macros available to the current document.
- Drag a macro from the list to the toolbar and release it, as shown in Figure J.
The document's macros are available.
Add a macro to the custom toolbar.
8: Update the captionBy default, the new macro button's caption isn't particularly helpful, so let's change it to something user-friendly. Right-click the new macro menu and change the Name setting to Print Shortcuts, as shown in Figure K. Just repeat this process to add any other necessary macros to the custom toolbar.
Give the macro button a name that users will recognize.
9: Work with the toolbarOnce you've created the custom toolbar, you can manipulate it the same way you do the built-in toolbars. Show users how to display it by righting-click the toolbar or menu bar's background and checking the toolbar, as shown in Figure L. Or choose Toolbars from the View menu and select the toolbar. To hide it, simply unselect it from the list. To dock the toolbar, double-click its title bar. Some users will be familiar with these tasks already, but they might not realize they can display and hide a custom toolbar.
Select the custom toolbar to display it.
10: Use VBA for more control
Allowing users to pick and choose their toolbars is fine. However, if you want to maintain more control in a template or document, use VBA to hide and display toolbars. The possibilities are numerous, but the following procedure displays the Special Functions toolbar when users open the document:
'Display custom toolbar.
CommandBars("Special Functions").Visible = TrueEnd Sub
Simply replace the name of any custom toolbar to make sure that toolbar is available. Use the CommandBars property in the following form to hide a toolbar:
CommandBars(barname).Visible = False
For example, the following statement hides the Standard toolbar:
CommandBars("Standard").Visible = False
To hide the menu bar, use the following statement:
CommandBars("Menu Bar").Enabled = False
Just when, and if, you execute these statements is up to you.
Susan Sales Harkins is an IT consultant, specializing in desktop solutions. Previously, she was editor in chief for The Cobb Group, the world's largest publisher of technical journals.