After changing the text inside of a table cell, the table is changing size on me and I don't know why. It seems like it is growing just a bit, but that small amount is throwing off our layout. I have attached a sample presentation.
Here is my code:
Sub Main()
Dim license As New Aspose.PowerPoint.License
license.SetLicense(AsposeLicensePath)
Dim powerPointDocument As New Aspose.PowerPoint.Presentation("C:\temp\SmallTable.ppt")
Dim slide As Aspose.PowerPoint.Slide = powerPointDocument.Slides(0)
For Each shape As Aspose.PowerPoint.Shape In slide.Shapes
ReplaceTextInShape(shape)
Next
powerPointDocument.Write("C:\temp\BigTable.ppt")
End Sub
Private Sub ReplaceTextInShape(ByVal shape As Aspose.PowerPoint.Shape)
If shape.GetType.Equals(GetType(Aspose.powerPoint.Table)) Then
Dim tableShape As Aspose.PowerPoint.Table = DirectCast(shape, Aspose.PowerPoint.Table)
For Each innerTableShape As Aspose.PowerPoint.Shape In tableShape.Shapes
ReplaceTextInShape(innerTableShape)
Next
ElseIf Not shape.IsTextHolder AndAlso Not shape.TextFrame Is Nothing Then
Dim paragraphs As Aspose.PowerPoint.Paragraphs = shape.TextFrame.Paragraphs
For Each paragraph As Aspose.PowerPoint.Paragraph In paragraphs
For Each portion As Aspose.PowerPoint.Portion In
paragraph.Portions
portion.Text = portion.Text +
“XXX”
Next
Next
End If
End Sub