Consulting

Results 1 to 2 of 2

Thread: Macros won't run in Action Settings On Mouse Click Mode

  1. #1
    VBAX Newbie
    Joined
    Nov 2007
    Posts
    1
    Location

    Macros won't run in Action Settings On Mouse Click Mode

    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
    Last edited by Aussiebear; 04-28-2023 at 08:10 PM. Reason: Added code tags

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    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
    Last edited by Aussiebear; 04-28-2023 at 08:11 PM. Reason: Adjusted the code tags
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •