albino_pygmy
08-11-2015, 02:40 AM
I'd like to have a macro where when I click on a shape "TriggerTest" during slideshow, that it will run the code below. I would like it to hide the button after clicked, and then find every shape on the current slide that has text in the textframe "Test" to change the font color from white to black.
Sub TriggerText()
Dim oShp As Shape
i = ActivePresentation.SlideShowWindow.View.CurrentShowPosition
ActivePresentation.Slides(i).Shapes("TriggerTest").Visible = False
For Each oShp In ActivePresentation.Slides(i)
With oShp.TextRange
If .Font.Color.RGB = RGB(255, 255, 255) Then
If ActivePresntation.Slides(i).Shapes.TextRange.TextFrame.Text = "Test" Then
.Font.Color.RGB = RGB(0, 0, 0)
End If
End If
End With
Next oShp
End Sub
I'm still fairly new to VBA and would be greatly appreciated if someone could take a look at this and fix my attempt at coding. Thanks!
Sub TriggerText()
Dim oShp As Shape
i = ActivePresentation.SlideShowWindow.View.CurrentShowPosition
ActivePresentation.Slides(i).Shapes("TriggerTest").Visible = False
For Each oShp In ActivePresentation.Slides(i)
With oShp.TextRange
If .Font.Color.RGB = RGB(255, 255, 255) Then
If ActivePresntation.Slides(i).Shapes.TextRange.TextFrame.Text = "Test" Then
.Font.Color.RGB = RGB(0, 0, 0)
End If
End If
End With
Next oShp
End Sub
I'm still fairly new to VBA and would be greatly appreciated if someone could take a look at this and fix my attempt at coding. Thanks!