Creating Custom Menus


Office comes with a powerful set of tools called Command Bars that let you modify the Office application menus or create your own from scratch. Here's a list of some of the things you can do with the Command Bars feature:

  • Move, rename, or delete existing menu commands.

  • Add commands to or delete commands from an existing menu or shortcut menu.

  • Create your own custom menus and attach them to any menu bar.

  • Delete menus from any menu bar.

  • Create your own menu bars.

The next few sections show you how to do all this and more.

Creating Custom Menu Bars

To create a custom menu bar, you use the same technique that you use to create a custom toolbar. See "Creating a New Toolbar" later in this chapter.


First, a Game Plan

Before you dive into the menu customization techniques outlined in the next few sections, you should take a step back to plan what you want to do and to consider the layout of your custom menus. You can use three levels of customization:

  • Menu commands This level involves adjusting existing commands or tacking new commands onto one or more of the application's built-in menus. Use this level when you have just a few changes to make.

  • Submenus This level involves adding one or more submenus to the application's built-in menu system. Use this level if you have several related procedures that you want to group together.

  • Menus This level involves creating an entirely new menu that appears in the application's menu bar. Use this level to create personalized menus or when you have many different procedures and you don't want to cram them all into the application's built-in menus.

Consider Other Users When You Customize

If other people use the Office programs on your computer, give some thought to what effect your menu customizations might have on them. People get used to the structure of menus, and you could seriously confuse other users if you make radical changes, especially to the built-in menus. Consider restricting your customizing to new menus that you create, or carefully document your changes and take the time to teach the new structure to the other users.


Customizing an Existing Menu

If all you need to do is customize one of the application's existing menus, follow the steps outlined earlier to display the Customize dialog box, and then use the following techniques:

  • To move a menu item to a different location, drag it within the menu.

  • To rename a menu item, right-click the item and then use the Name text box to edit the item name.

  • To delete a menu item, either drag it off the menu or right-click it and then click Delete.

Resetting the Menu

If you no longer want to keep your changes, you can revert a built-in menu to its default configuration by right-clicking the menu name and then choosing Reset from the shortcut menu.


Creating a New Menu

If you'll be adding many new commands to the application's menu system, you might not want to bog down the existing menus with too many items. To keep things clean, you can create a custom menu just for your commands. Here are the steps to follow:

1.

Select Tools, Customize to display the Customize dialog box.

2.

Select the Commands tab.

3.

In the Categories list, select New Menu, as shown in Figure 10.4.

Figure 10.4. Use the Commands tab in the Customize dialog box to create new menus in the application.


4.

In the Commands list, click and drag the New Menu item up to the menu bar. You'll see a vertical bar that marks the spot where the new menu will appear. When the bar is positioned where you want your menu, drop the New Menu item.

5.

Right-click the new menu and then use the Name box on the shortcut menu to name your new menu. Place an ampersand (&) before whichever letter you want to use as an accelerator key. (Make sure the key you choose doesn't conflict with an accelerator key used by any other menu.) For example, if your new menu is named Macros, entering the name as &Macros will set up the "M" as the accelerator key, which means you can select the menu by pressing Alt+M.

6.

Press Enter.

Quickly Rearranging Menu Bar Items

If you want to change the order of the menu bar items, you can do so without displaying the Customize dialog box. Hold down the Alt key and drag the menu bar item left or right. You can also delete a menu bar item by holding down Alt and dragging the item off the menu bar.


Getting Easy Document Access with Word's Work Menu

If you have several documents that you use regularly, it's time consuming and inefficient to always use the Open command to locate and open these documents. You can save time by choosing documents from the File menu's list of most recently used files, but there's no guarantee all your regular documents will be available on that list.

To ensure easy access to your regular files, add Word's little-known Work menu to your menu bar by following these steps:

1.

Select Tools, Customize to display the Customize dialog box.

2.

Select the Commands tab.

3.

In the Categories list, select Built-in Menus.

4.

In the Commands list, click and drag the Work item and drop it on the menu bar.

5.

Click Close.

To add a document to the Work menu, open the document and then select Work, Add to Work Menu.

Deleting an item from the Work menu takes a bit more work. You'd think you could just select Tools, Customize, drop down the Work menu, and then drag the item off the menu. That would be nice, but it doesn't work because when you drop down the Work menu while the Customize dialog box is displayed, you just see (List of Work Files) at the bottom of the menu. Instead, you have to add a special command to the Work menu, as detailed in the following steps:

1.

Select Tools, Customize to display the Customize dialog box.

2.

Select the Commands tab.

3.

In the Categories list, select All Commands.

4.

In the Commands list, click and drag the Tools Customize Remove Menu Shortcut item and drop it onto the Work menu.

5.

Click Close.

To delete an item from the Work menu, select the Work, Tools Customize Remove Menu Shortcut command. The mouse pointer changes to a horizontal bar. Pull down the Work menu again and then click the item you want to delete. Word immediately removes the item from the Work menu.

Creating a New Submenu

To work with submenus, you have two choices:

  • Add the submenu to the new menu you created in the preceding section.

  • Add the submenu to one of the application's built-in menus.

Either way, you follow the steps outlined in the preceding section. However, instead of dragging the New Menu item to the menu bar, drag it to an existing menu. When the menu pulls down, drag the mouse pointer down into the menu to the position where you want the submenu to appear. (A black horizontal bar shows you where the menu will be positioned.) When you drop the item, a new submenu is created.

To rename the submenu item, right-click the item and then use the Name text box to enter the new name (including an accelerator key).

Adding Menu Commands

You're now ready to create custom menu commands. Remember that you can create these commands in any of the following locations:

  • On a custom menu that you've created

  • On a custom submenu that you've created

  • On one of the application's built-in menus

Here are the steps you need to work through:

1.

Select Tools, Customize to display the Customize dialog box.

2.

In the Categories list, highlight the category that contains the command you want.

3.

In the Commands list, click and drag the command you want to a custom menu, a custom submenu, or a built-in menu.

4.

When the menu opens, drag the item down into the menu and then drop the item at the position where you want the command to appear.

Creating Custom Commands for Macros

In Chapter 11, "Maximizing Office with VBA Macros," I'll show you a number of methods for running your VBA macros. However, all these methods assume that you know which task each macro performs. If you're constructing procedures for others to wield, they might not be as familiar with what each macro name represents. Not only that, but you might not want novice users scrolling through a long list of procedures in the Macro dialog box or, even worse, having to use the Visual Basic Editor.

To help you avoid these problems, you can make your macros more accessible by assigning them to custom menu commands, as explained in the next two sections.

Custom Macro Commands in Word, PowerPoint, and Access

Follow these steps to add a custom command for a macro in Word, PowerPoint, and Access:

1.

Select Tools, Customize to display the Customize dialog box and then select the Commands tab.

2.

In the Categories list, select the Macros item. (In Access, select the All Macros item.)

3.

In the Commands list, drag the macro you want to work with to a custom menu, a custom submenu, or a built-in menu.

4.

When the menu opens, drag the item down into the menu and then drop the item at the position where you want the command to appear.

5.

Right-click the item and then use the Name box on the shortcut menu to edit the macro name, if necessary. Place an ampersand (&) before whichever letter you want to use as an accelerator key.

6.

Press Enter.

Creating Command Groups

You've probably noticed that Office applications group related menu commands by using separator bars. You can do the same for your custom menus. With the Customize dialog box displayed, pull down the menu, right-click the first command in the group you want to create, and then click Begin a Group. The application adds a separator bar above the selected command.


Custom Macro Commands in Excel

Excel uses a slightly different method for creating custom macro commands:

1.

Select Tools, Customize to display the Customize dialog box and then select the Commands tab.

2.

In the Categories list, select the Macros item.

3.

In the Commands list, drag the Custom Menu Item command to a custom menu, a custom submenu, or a built-in menu.

4.

When the menu opens, drag the item down into the menu, and then drop the item at the position where you want the command to appear.

5.

Right-click the item and then use the Name box on the shortcut menu to name your new menu. As before, place an ampersand (&) in front of whichever letter you want to use as an accelerator key. (To ensure that the menu remains onscreen, don't press Enter when you're done.)

6.

Click Assign Macro. The Assign Macro dialog box appears.

7.

In the Macro Name list, select the macro you want to assign to the new menu command and then click OK.

Deleting Menus and Menu Commands

If you no longer need a custom menu, submenu, or command, you can use a couple of methods to delete these items. First, select Tools, Customize to display the Customize dialog box, and then try either of these techniques:

  • Use the mouse to drag the item off the menu or menu bar and drop it outside the application's menu system.

  • Right-click the item and then click Delete on the shortcut menu.



Tricks of the Microsoft Office Gurus
Tricks of the Microsoft Office Gurus
ISBN: 0789733692
EAN: 2147483647
Year: 2003
Pages: 129

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net