I would like to replace the word "hello" with "world" on slide 1 of the ppt. How can I do that using VBA script.
Sub findAndReplaceText()
Dim sld As Slide
Set sld = ActivePresentation.Slides(1)
Dim shp As Shape
For Each shp In sld.Shapes
If shp.HasTextFrame Then
If shp.TextFrame.HasText Then
shp.TextFrame.TextRange.Text = Replace(shp.TextFrame.TextRange.Text, "hello", "world")
End If
End If
Next shp
End Sub
Reference: https://www.youtube.com/watch?v=BYfKvVmtAGE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With