PDA

View Full Version : Macros won't run in Action Settings On Mouse Click Mode



jess7878
11-22-2007, 10:31 AM
Hello all,

I'm trying to get a text box to change color when that particular text is clicked on in Slide Show mode. I recorded a macro where I selected the text box, then changed the color. Then I added the macro in "Action Settings" on the text box and clicked for the macro to run on mouse click, but it won't work. The macro will run if I go into the macro menu and hit "run" but it won't do it on mouse click in slide show mode. Any solutions?

Here's the VBA script from my recorded macro:


Sub grey()
' Macro recorded 11/22/2007 by JB
ActiveWindow.Selection.SlideRange.Shapes("Rectangle 26").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
ActiveWindow.Selection.TextRange.Font.Color.SchemeColor = ppShadow
End Sub

John Wilson
11-23-2007, 06:19 AM
Hi Jess

First of all the macro recorder rarely produces useable code! This is a typical example. You can't have a selection in slide show mode and so the code will never run.

Here's some code to try:

Sub changeme()
ActivePresentation.SlideShowWindow.View.Slide.Shapes("Rectangle 26").Fill.ForeColor.RGB = RGB(255, 0, 0)
End Sub

An alternative to change the shape THAT IS CLICKED


Sub changeme2(oshp As Shape)
oshp.Fill.ForeColor.RGB = RGB(255, 0, 0)
End Sub