Creating Custom Toolbars for Your Macros

   

Creating Custom Toolbars for Your Macros

Menu commands are fine, but there's nothing like a toolbar's one-click access for making your macros easy to run. This section shows you how to create custom toolbars, populate them with buttons, and assign macros to these buttons .

Creating a New Toolbar

Theoretically, you could add new buttons to the application's built-in toolbars, but you run the risk of overcrowding them and possibly confusing your users. Instead, you can create a toolbar from scratch and add custom buttons to it. Here are the steps to follow to create a new toolbar:

  1. Either select Tools, Customize or right-click a toolbar and select Customize from the shortcut menu. The application displays the Customize dialog box.

  2. Activate the Toolbars tab.

  3. Click the New button. The New Toolbar dialog box appears, as shown in Figure 14.4.

    Figure 14.4. Use this dialog box to name your new toolbar.

    graphics/14fig04.jpg

  4. Use the Toolbar name text box to enter the name you want to use for the toolbar and then click OK. The application displays a new, empty toolbar.

Adding a Toolbar Button and Assigning a Macro

Once you have your new toolbar, you can start adding buttons to it for your macros. Follow these steps:

  1. In the Customize dialog box, select the Commands tab.

  2. In the Categories list, highlight the Macros item.

  3. In the Commands list, drag the Custom Button item and drop it on your new toolbar.

  4. Either right-click the button or click Modify Selection and then use the Name box on the shortcut menu to name your new button. This is the text that will appear when the user hovers the mouse pointer over the button for a second or two.

  5. To change the button face, click Change Button Image and then choose an image from the menu that appears. Alternatively, you can click Edit Button Image and use the Button Editor to create a custom image.

  6. In the Modify Selection list, click Assign Macro to display the Assign Macro dialog box.

  7. Use the Macro name list to highlight the macro you want to assign to the new menu command and then click OK.



Absolute Beginner's Guide to VBA
Absolute Beginners Guide to VBA
ISBN: 0789730766
EAN: 2147483647
Year: 2003
Pages: 146

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