Solved

Macro to Update a Placeholder in PowerPoint

Posted on 2014-11-05
4
269 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
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 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 48

Expert Comment

by:Rgonzo1971
ID: 40427817
Hi,

Replace Client Name with [CLIENT NAME]

Regards
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Background   Certain code in VBA requires initialization, such as application events. The app initialization is often triggered by the Auto_Open sub which is a special procedure that runs when an add-in loads. More significantly, this sub does n…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This video teaches viewers how to create handouts from their slides and helps them decide how many slides to include per handout.
The viewer will learn how to edit the master slide. They will also learn how to combine multiple themes into one master slide to use them in their presentation.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now