PDA

View Full Version : Solved: Read custom prompt text from a text placeholder



vburiko
06-10-2013, 08:06 AM
I need to identify a text placeholder on a slide by the custom prompt text (for instance "Click to add number"). I can read the user own content by using:
strPlaceholderText =
ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange.Text
but for custom prompt text it returns an empty string. I looked through the Placeholder and Shape objects methods and properties, but do not see anything that can point me in the right direction.
I am using Microsoft Office 2013, Windows 7, 64 bit.

John Wilson
06-11-2013, 04:12 AM
You can only read this from the corresponding custom layout. It's easy to get the relevant layout but there's no reliable way to relate the shapes on the slide to the placeholders on the layout if they have been moved around.

Sub getC()
Dim ocust As CustomLayout
Set ocust = ActivePresentation.Slides(1).CustomLayout
MsgBox ocust.Shapes(1).TextFrame2.TextRange ' may not relate to shapes 1 on the slide
End Sub