Free Support Forum - aspose.com

Use of Tables

Hey everyone,

Ive been tasked with converting someone elses PP automation to use Aspose Slides. Having not written the original code myself, Im struggling, but getting through. I have what seems to be most of the PP to Aspose changes made, but one is throwing me and Im not sure what to do. Im hoping to not have to redesign from scratch to achieve what is being done currently.

If table_height > allowed_table_height Then
' Merge last set of columns
If previous_type_description = type_description Then
item_count_previous_page = k - 1
With pptPres.Slides.Item(slide_number).Shapes.Item(2).table
If (n_rows >= k) Then
If (n_rows > initial_row) Then
' Now merge all the cells of the Top row
.Cell(initial_row, 1).Merge(.Cell(n_rows, 1)
oShapeInsideTable = .Cell(initial_row, 1).Shape
Else
' Now grab a reference of the shape which represents the merged cell
oShapeInsideTable = .Cell(n_rows, 1).Shape
End If
Else
' Now grab a reference of the shape which represents the merged cell
oShapeInsideTable = .Cell(n_rows, 1).Shape
End If
With oShapeInsideTable
With .TextFrame.TextRange
.Text = type_description
.ParagraphFormat.Alignment = Microsoft.Office.Interop.PowerPoint.PpParagraphAlignment.ppAlignCenter'
With .Font
.Bold = True'
.Size = 8
.Color.RGB = RGB(0, 0, 0)
End With
End With
End With
End With
End if

This is just an piece of a class, which may not make much sense, but I have my fingers crossed someone can point me in the right direction. The problem is with the line
With pptPres.Slides.Item(slide_number).Shapes.Item(2).table
where the error message is 'table' is not a member of 'Apose.Slides.Shape'

Any ideas where to go from here?
Thanks guys
Ross

Hello Ross,

If I’m not mistaken this code doesn’t use Aspose.Slides. That is OLE automation only.

the project originally was, but now im trying to use aspose slides instead. perhaps my method of conversion isnt so good and i should review from the beginning. but near towards the top of the class i have this line

Dim pptPres As Aspose.Slides.Presentation = New Presentation(file_path)

and i go from there.

In this case try to check in the debugger what type each shape has.
Most probably order of shapes in the Aspose.Slides differ from order in ole automation.
Instead of using debugger you can iterate shapes and write types to log or console.