Sub ClearTextboxOnResponse()
Dim userChoice As VbMsgBoxResult
Dim shp As Shape
' Show a message box with Yes/No buttons
userChoice = MsgBox("Do you want to clear the text box?", vbYesNo + vbQuestion, "Clear Text")
If userChoice = vbYes Then
' Reference the shape named "TextBox1" on the current slide
Set shp = ActivePresentation.SlideShowWindow.View.Slide.Shapes("TextBox1")
' Clear the text
shp.TextFrame.TextRange.Text = ""
End If
End Sub
I'm assuming you are in Slide show view (using SlideShowWindow.View.Slide) and there is a shape named TextBox1 on the current slide.
If you're not in Slideshow mode then change:
Set shp = ActivePresentation.SlideShowWindow.View.Slide.Shapes("TextBox1")
to
Set shp = ActivePresentation.Slides(1).Shapes("TextBox1") ' Replace "1" with your slide number