Leading the way in Microsoft Office Development
 Home|Excel|Word|PowerPoint|Consultancy|Feedback|Contact 
 Microsoft PowerPoint > Macros > Running a Macro from a Toolbar< Previous | Next > 

 

Step 1 - Write or Record the Macro

 
 

Any macros that you want to be accessible from any presentation should be saved as an add-in.

 
 

For more information about PowerPoint add-ins, please see the Add-ins section.

 
 

If you are recording the macro the VBA code will always be stored in the active presentation.

 
 

There is a very importance difference between macros in PowerPoint and macros in Excel.

 
 

In Excel you can add a custom button to a toolbar before the macro has been written and then assign the macro afterwards.

 
 

This is not possible in PowerPoint. It is not possible to assign a different macro once it has been added to a toolbar.

 
 

For this reason the macro must be written first.

 

 

Step 2 - Display the Customise dialog box

 
 

Before you do this make sure that the macro has been recorded (or written) and that the toolbar you want to add the button to is visible.

 
 

Select (Tools > View > Customise) or alternatively select (Tools > Customise).

 
 

Select the Commands tab. Scroll to the bottom of the Categories list and select "Macros".

 
 

In the Commands list box, there will be a list of all the macros available in the active presentation.

 
 

There are two macros currently available. Select "Macro1".

 
 

 (Tools > Customise) dialog box

 

 

Step 3 - Add the additional Toolbar button

 
 

To add an additional button to an existing toolbar drag the "Macro1" button in the Commands list box to the toolbar.

 
 

You will see a black line appear indicating where the button or command will appear if you release the mouse button.

 
 

If you are adding several custom buttons to a toolbar it is quicker to add one custom button and then to copy that using the Ctrl key.

 
 

Hold down the Ctrl key and drag and drop the button to create a copy.

 

 

Step 4 - Change the Macro

 
 

To make changes to this button press the "Modify Selection" drop-down menu or alternatively right click on the actual button.

 
 

There is a very importance difference between macros in PowerPoint and macros in Excel.

 
 

Notice that there is no "Assign Macro…" option at the bottom of the shortcut menu.

 
 

 Shortcut menu when you right mouse click on a custom button

 
 

It is possible to display both an image and text by selecting the "Image and Text" option.

 
 

You can change the icon that is displayed on the toolbar by using the "Change Button Image" submenu. This is discussed later.

 

 

Step 5 - Things to Remember

 
 
  • You can remove a button from a toolbar by dragging the button from the toolbar and releasing it over the "Customise" dialog box.

     
     
  • You can also remove a button from a toolbar by holding down the Alt key as you drag the button. This method does not require the (Tools > View > Customise) dialog box to be displayed.

     
     
  • Technically you don’t have to actually write the full macro before you can assign it to a toolbar, but just create the subroutine with the correct name.

     
     
  • For more information on how to customise your toolbars, please see the Toolbars & Menus section.

     

     Copyright © 2004-2007 Better Solutions Limited. All Rights Reserved.< Previous | Top | Next >