Formatting Text in table cells


#1

I am adding a table to some slides and want to copy data from an html table to a table in a ppt slide. When I copy in the data I am formating it and it works fine for all the rows except the first one what am I doing wrong?


If Not table Is Nothing Then

table.ZOrder(ZOrderCmd.BringForward)

For i = 0 To fpspr.Sheets(0).RowCount - 1

If i + 1 > table.RowsNumber Then

table.AddRow()

End If

table.GetCell(1, i).TextFrame.Paragraphs(0).Portions(0).FontHeight = 10

table.GetCell(1, i).TextFrame.WrapText = True

table.GetCell(1, i).TextFrame.Paragraphs(0).HasBullet = 0

table.GetCell(1, i).TextFrame.Paragraphs(0).Alignment = TextAlignment.Center

table.GetCell(1, i).TextFrame.Paragraphs(0).Portions(0).Text = fpspr.Sheets(0).Cells(i, 1).Value



Next

End If

attached is a picture of what I am seeing.


#2

Hello,

Please, could you send also source ppt with table?


#3

attached is the source ppt file


#4

I found something of importance. It seems the format is only stored if there is text to apply that format to. To get around this I put dummy data in my template and then it holds format so that I can add new text and rows and have the formatting keep.
Perhaps this is a “feature” you want to document so others working with tables will know how to overcome this.

Ray


#5

Dear Ray,

It’s normal situation.
Text formatting can be stored together with text only.
If you don’t have text in the table then you also don’t have any formatting.

Really, text inserted to the empty text frame will have default style which is defined on MainMaster.