Consulting

Results 1 to 1 of 1

Thread: Powerpoint VBA Button Hover Effect for shape within a group

  1. #1

    Powerpoint VBA Button Hover Effect for shape within a group

    I'm trying to set up a button hover effect using code from this article:
    https://www.brightcarbon.com/blog/su...th-vba-part-2/


    On the button shape I use this for the hover:

    Public Sub GraphicHover(ByRef oGraphic As Shape)
        oGraphic.Fill.ForeColor.ObjectThemeColor = msoThemeColorAccent1
    End Sub
    And to reset it I use this on a shape covering the rest of the slide:



    Public Sub ResetGraphicHover(ByRef oCover As Shape)
    Dim oSld As Slide
    Dim oShp As Shape
    Set oSld = oCover.Parent
    For Each oShp In oSld.Shapes
       With oShp.Fill.ForeColor
           If .ObjectThemeColor = msoThemeColorAccent1 Then .ObjectThemeColor = msoThemeColorDark1
       End With
    Next
    End Sub

    I have it working, however I now want to group my button shape. When I group it the hover works, but not the reset.
    Is there an easy way to adjust the code to work with grouped shapes?


    Thanks
    Last edited by Aussiebear; 08-09-2022 at 12:33 AM. Reason: reduced whitespace

Posting Permissions

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