PowerPoint tips, hints and tutorials that will change your presentations for ever!



Custom Shows
vba code
Games for teachers
Flash Cards
Multiple Instances
PowerPoint 2007
Mail Merge
Random events
Set spellcheck language

Home buttonTutorial buttonContact buttonProducts button

How to Add a Ribbon Entry That Runs a Macro in 2007

In earlier versions quite a lot of code was needed to add a button or menu to run macros in an add in. In 2007 though it is much simpler the method may be unfamiliar.

Here's how to write a simple add in in 2007 with a ribbon entry. NB this is just the basics!

First write your code:

Open the vbe with Alt f11 and insert a module. Add the simplest code in the world!

Sub Hello()
MsgBox "Hello!"
End Sub

Feel free to write your own code if you wish!!

Now save as a pptm file.

The easiest way to add xml to a pptm file is to use "Office 2007 Custom UI Editor" it's free and you can get it here:

Get Custom UI Editor

Now run the editor and use it to open your pptm file. You just need to add the xml to the window and save and all is done.

Here's the xml for this simple project:


IF YOUR MACRO ISN'T CALLED "Hello" change the onAction

NOTE IN XML CASE is important

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<tab idMso="TabAddIns">
<group id="CustomGroup1" label="My Stuff">
<button id="Custombutton1" onAction="Hello" showImage="true"
imageMso="AcceptInvitation" size="large" label="Run This Macro" />


In the Custom Ui Editor Insert > 2007 Custom UI Part. Note you do NOT need to choose 2010 Part unless you need features that only appear in 2010/13 (Not likely at this stage)

Select 2007 or 2010


Now Paste in the XML Code above. save the file.

When you open the pptm you should now have a new entry in the AddIns tab that will run the macro. Save as a ppam Add In and the ribbon entry is included. You will need to load the AddIn just the first time and after that it will always be available

Change the XML If You Need More

Change the label text to alter the ribbon heading

Change onAction text for a different macro

More buttons?? After the line <button id ................/> add a similar line with a different button id and onAction Macro. You must use unique ids for the buttons.

Two buttons

To make the entry in the Home Tab use TabHome instead of TabAddIns

The image "Accept Invitation" is a green tick

CancelRequest is a red X


This is of course just the start try googling for Ribbonx or Custom UI Editor


COMPLETELY STUCK? We can do this for at a very competive rate! Contact

Free kit to make your own AddIn.



Back to the Index Page


Articles on your favourite sport

Free Microsoft PowerPoint Advice, help and tutorials, Template Links
This website is sponsored by Technology Trish Ltd
© Technology Trish 2007
Registered in England and Wales No.5780175
PowerPoint® is a registered trademark of the Microsoft Corporation