Consulting

Results 1 to 2 of 2

Thread: Solved: Read custom prompt text from a text placeholder

  1. #1
    VBAX Newbie
    Joined
    Jun 2013
    Posts
    1
    Location

    Solved: Read custom prompt text from a text placeholder

    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:
    [VBA]strPlaceholderText =
    ActivePresentation.Slides(1).Shapes(1).TextFrame.TextRange.Text[/VBA]
    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.

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    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
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •