![]() |
Leading the way in Microsoft Office Development |
| Home | | | Excel | | | Word | | | PowerPoint | | | Consultancy | | | Feedback | | | Contact |
| Microsoft PowerPoint > Macros > Running a Macro from a Menu | < 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 menu 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 menu. | ||
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 Menu button |
To add an additional button to an existing menu drag the "Macro1" button in the Commands list box to the drop-down menu. | ||
Dragging the button to the top of an existing drop-down menu will expand the menu and allow you to place the command button anywhere on the menu. | ||
You will see a black line appear indicating where the button or command will appear if you release the mouse button. | ||
It is also possible to add command buttons to existing submenus, just drag the button over the submenu triangle. |
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 menu item |
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 drop-down menu by dragging the button from the menu and releasing it over the "Customise" dialog box. | |||
You can also remove a button from a menu by holding down the Alt key as you drag the button. This method does not require the (View > Toolbars > 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 drop-down menus, please see the Toolbars & Menus section. |
| Copyright © 2004-2007 Better Solutions Limited. All Rights Reserved. | < Previous | Top | Next > |