How to Find and Replace text in the Master and Layout slides?

Context

I have master slide and 60 layout slides. Do not ask why, but I would like to Find and Replace text in the dummy texts, titles in the master slide and its 60 layout slides.

What I've tried...

...is to switch to Slide Master, then use the Find dialog by pressing ctrl+F. However when I start the Find pressing button [Find Next], PowerPoint instantly switches back to Normal View and searches in the actual presentation content.

Question

Is there any way to Find and Replace in the master slide and its layout slides, in the dummy placeholder texts?

1

1 Answer

Turns out that you can do the search/replace with a bit of VBA:

' Use this to test the replacement
' Usage: Call ReplaceTextInLayouts (text to replace, text to replace it with)
Sub TestReplace() Call ReplaceTextInLayouts("BETTER", "WORSE")
End Sub
Sub ReplaceTextInLayouts(sSearchFor As String, sReplaceWith As String) Dim oSh As Shape Dim oLay As CustomLayout With ActivePresentation For Each oLay In .SlideMaster.CustomLayouts For Each oSh In oLay.Shapes If oSh.HasTextFrame Then With oSh.TextFrame.TextRange If InStr(.Text, sSearchFor) > 0 Then Call .Replace(sSearchFor, sReplaceWith) End If End With End If Next Next End With
End Sub

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like