In all recent versions of PowerPoint it is possible to trigger animations. This means the animation takes place when a certain shape is clicked. This allows you to run animation “on demand” and outwith the normal sequence of mouse clicks.
There is no obvious way to run an animation when a shape is just “moused over” rather than clicked. This is a common feature in web pages but not available in PowerPoint. A typical use might be to show a map or definition when an item is “moused over” and remove it again later.
Let’s start by creating a triggered animation.
Look at the screen shot. If the text has a fade animation and a fade exit in PowerPoint it will currently appear on the first click and fade away on the second. The desired behaviour is it will fade in on the first click ON THE TRIGGER SHAPE and out again on a second click of the shape.
To achieve this open the animation pane. Select both the fade in AND fade out entries (hold down CTRL) and set a trigger of the rectangle from the ribbon as shown. If you have an earlier version of PowerPoint you can use the drop arrow (circled) to choose TIMING and set the trigger here.
When you run the slide show ("DEMO1.pptx") you should find that the text fades in when the button is pressed and out again on a second press.
So far, so good but how to make this happen on mouseover?
A useful trick you may not know is essential to getting mouse over animation to work. Run the slide show again but this time press TAB and then ENTER. The animations take place, as if you had clicked the shape.
Press The Keys On Mouse Over
It is possible to trigger a macro on Mouseover. Select the train image and Insert Action.
Open the Visual Basic Editor (ALT + f11).
Insert a module and paste in this simple code.
Sub anim(oshp As Shape)
Dim osld As Slide
Set osld = oshp.Parent
'Note alter the name here to match the trigger shape
If osld.Shapes("Rectangle 7").ZOrderPosition = 1 Then
osld.Shapes("Rectangle 7").ZOrder (msoSendToBack)
Give the picture a mouseover
action of Run Macro
Most programmers hate using SENDKEYS but it is the only simple way to do this.
Finally if you don’t want to see the blue trigger shape in the show you can move it off slide where in will never be visible.
Text the sample DEMO1_code.pptm file.
Since the image now also has an action you need to be sure that TAB ENTER activates the trigger button and not the macro or you will get into a code loop. To do this make sure the button is sent to the back. TAB ENTER will always activate the first shape with an action. This is why the code checks that the trigger shape is at the back and moves it if necessary.
This is the demo file without code.
You may download a fully working example here. Note it is in .ppt format as Experts Exchange does not yet support uploaded .pptm files. Make sure you have macros and editing enabled when you try it.