I'm trying to make a macro where it will change the text of the button that is clicked by the user.
I already tried the oShape
declaration mentioned in Microsoft's forum.
Here's what I have:
Sub changeLetter(oShape As Shape)
If ActivePresentation.Slides(oShape.Parent.SlideID).Shapes(oShape.Name).TextFrame.TextRange.Text = "a" Then
ActivePresentation.Slides(oShape.Parent.SlideID).Shapes(oShape.Name).TextFrame.TextRange.Text = "b"
ElseIf ActivePresentation.Slides(oShape.Parent.SlideID).Shapes(oShape.Name).TextFrame.TextRange.Text = "b" Then
ActivePresentation.Slides(oShape.Parent.SlideID).Shapes(oShape.Name).TextFrame.TextRange.Text = "a"
End If
End Sub
What I have here is a toggle between "a" and "b".
EDIT: I decided to use command buttons instead:
Private Sub letter1_Click()
If letter1.Caption = "a" Then
letter1.Caption = "b"
ElseIf letter1.Caption = "b" Then
letter1.Caption = "a"
End If
End Sub
EDIT 2: I tried using command buttons but I just keep ending up with the "Invalid outside procedure" error
EDIT 3: I got it to work! My apologies!