This sample was created directly through Powerpoint. I believe all that I did was create a new slide with layout "title and text", enter some text into the place holders, and then change the layout to "title only".
So... according to your last post, there is no harm in changing text of a shape that is a placeholder, I just need to go through the place holders too?
my original algorithm is:
Replace tokens on a slide:
For Each shape As Aspose.Slides.Shape In slide.Shapes
For i As System.Int32 = 0 To slide.Placeholders.Count - 1
Dim holder As Aspose.Slides.Placeholder = slide.Placeholders(i)
If holder.GetType.Equals(GetType(Aspose.Slides.TextHolder)) Then
Dim textHolder As Aspose.Slides.TextHolder = DirectCast(holder, Aspose.Slides.TextHolder)
Public Shared Sub ReplaceTokensInShape(ByVal shape As Aspose.Slides.Shape)
If shape.GetType.Equals(GetType(Aspose.Slides.GroupShape)) Then
Dim groupShape As Aspose.Slides.GroupShape = DirectCast(shape, Aspose.Slides.GroupShape)
For Each shapeInGroup As Aspose.Slides.Shape In groupShape.Shapes
ElseIf shape.GetType.Equals(GetType(Aspose.Slides.Table)) Then
Dim tableShape As Aspose.Slides.Table = DirectCast(shape, Aspose.Slides.Table)
For Each shapeInGroup As Aspose.Slides.Shape In tableShape.Shapes
ElseIf Not shape.IsTextHolder AndAlso Not shape.TextFrame Is Nothing Then
I have bolded the place where the logic fails because the placeholder/shape has IsTextHolder = True so it never calls ReplaceTokensInParagraphs.
If I understand what you're saying I can remove this part of the if clause....
Does that sound correct? I'm sorry to give you all this VB code.....so, I can access the text of a placeholder through the shape object or through the placeholder object (assuming it exists)....