Originally Posted by
John Wilson
Shapes on a slide don't usually inherit the name, id or tags from the custom layout IF they are empty placeholders. You need to explain EXACTLY what you are doing and what you need to achieve. I see you have asked this same question elsewhere - always best to mention this
I tried to link this to my similar post on MSDN but it appears it is forbidden by this forum to do so. In any event, I replied to you there. Yes, I am using empty placeholders.
What I'm trying to do isn't that complicated to explain but I appear to be missing the mark. I'll simplify.
- I have a single slide presentation with two different custom layouts for that slide.
- I am using a VBA enabled PPTM userform to populate a textbox in the header and two text placeholders that change position depending on the layout chosen.
- The placeholders are empty save for the placeholder description.
- I name the header textbox "HeaderTextBox" and the two text placeholders "Caption1" and "Caption2"
- My VBA code then looks for the shapes and adds text from the userform by executing
With ActivePresentation.Slides(1)
.Shapes("HeaderTextBox").TextFrame.TextRange.Text = UFrm_Information.TBox_HeaderData
.Shapes("Caption1").TextFrame.TextRange.Text = UFrm_Information.TBox_Caption1
.Shapes("Caption2").TextFrame.TextRange.Text = UFrm_Information.TBox_Caption2
End With
This works as intended UNLESS I change from the first layout to the second. Then my HeaderTextBox,Caption1,Caption2 names for those shapes are replaced by default names assigned by PowerPoint. I.e. Caption1 becomes Text Placeholder 72.