Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Macro to Update a Placeholder in PowerPoint

Posted on 2014-11-05
4
Medium Priority
?
406 Views
Last Modified: 2014-11-11
I want to have a Macro that will update a Text Box or Place Holder in my PowerPoint across Multiple Slides.

Basically I have a PowerPoint Presentation and have to manually change the Name of the Client on each slide where the Text Box is. I would like to have an Input Box pop up when I open the file and I would then just type in the Client Name and it would dynamical find all the "Client Name" Text Boxes/Placeholders and replace the contents of the Text Box/Placeholder with what ever I type in the Input Box.

I've named the Text Box the same thing "Client Name" to help with getting this done.

I have attached a sample Presentation with slides and notes on what I would like the Macro to do.
SlideExample.pptx
0
Comment
Question by:thomas-sherrouse
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 52

Accepted Solution

by:
Rgonzo1971 earned 1500 total points
ID: 40425588
Hi,

pls try

Sub updateClientName()
strClientName = InputBox("Enter Client name")
If strClientName <> "" Then
    For Each Pg In Application.ActivePresentation.Slides
        For Each obj In Pg.Shapes
            If obj.HasTextFrame Then
                If obj.TextFrame2.TextRange.Text = "[CLIENT NAME]" Then
                    obj.TextFrame2.TextRange.Text = strClientName
                End If
            End If
        Next
    Next
End If
End Sub

Open in new window

Regards
0
 
LVL 23

Expert Comment

by:JSRWilson
ID: 40425643
You don't really need code to do this just the built in REPLACE command.
0
 

Author Comment

by:thomas-sherrouse
ID: 40427152
Rgonzo1971 - I used the code and the Input box works, but it doesn't update the "Client Name" box.
0
 
LVL 52

Expert Comment

by:Rgonzo1971
ID: 40427817
Hi,

Replace Client Name with [CLIENT NAME]

Regards
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This video teaches viewers how to fit pictures into slides, crop and remove backgrounds, and alter photos to look more professional.
This video teaches viewers how to create handouts from their slides and helps them decide how many slides to include per handout.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question