Solved

Macro to Update a Placeholder in PowerPoint

Posted on 2014-11-05
4
278 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 49

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 49

Expert Comment

by:Rgonzo1971
ID: 40427817
Hi,

Replace Client Name with [CLIENT NAME]

Regards
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Most folk recognise that Microsoft Excel, being a numbers-and-formulae-centric application attracts programmers due to the natural fit in mindset. Conversly, when opening Microsoft's dominant presentation creative application, few consider what…
Introduction In all recent versions of PowerPoint it is possible to trigger animations. This means the animation takes place when a certain shape is clicked. This allows you to run animation “on demand” and outwith the normal sequence of mouse cl…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
The viewer will learn how to edit text. This includes Font, Spacing, Resizing, Color, and other special text options.

895 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