Replace All Text in a TextFrame

J

Jeff Jones

I'm running PowerPoint 2003, SP2 and have many presentations that have
differing dates in a TextFrame in the TitleMaster. It's easy to
establish an object and replace the year, for example, but since I
don't know the day and month I need to replace all the text in the
TextFrame. Trying to do so using a constant doesn't work because an
object is required.

Has anyone any ideas how to spin through the shapes on the TitleMaster
and when I get to the TextFrame with the date in it replace all the
data with a new date?

Thank you,
Jeff
 
G

Guest

Assuming the date is in the date area placeholder

Sub datechange()
Dim oshp As Shape
For Each oshp In ActivePresentation.SlideMaster.Shapes
If oshp.HasTextFrame And oshp.TextFrame.HasText Then
If oshp.PlaceholderFormat.Type = 16 Then
oshp.TextFrame.TextRange = "insert date here"
End If
End If
Next
End Sub
--

Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html
 
J

Jeff Jones

Hi John,

Unfortunately the TextFrame is not the standard date placeholder.

However, maybe the line where the TextRange sets the date will do the
trick.

Is there a way to validate the name of a text box? For example I know
that at least in some of the TitleMasters the object I want it "Text
Box 10" so if I can ascertain this property, then it's easy to select
it and replace the text within it.
 
J

Jeff Jones

Hi John,

The line below worked! Thank you VERY much. I was really wrestling
with this wonderfulness.

oshp.TextFrame.TextRange = "insert date here"

I wish you enough,
Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top