Free Support Forum -

Table ex issue

i am accessing a table using the code given in the from the website and was wondering if I wanted to add another row at the bottom of the existing table would that be possible if so how would I go about doing so.

the table has 6 column


Thanks for inquiring Aspose.Slides.

I like to share that you can use TableEx.Rows.InsertClone() or TableEx.RowsAddClone() method for adding new rows in the slide table. The following sample code will help you in this regard.

PresentationEx pres = new PresentationEx();

SlideEx slide = pres.Slides[0];

double[] widths = new double[1];
double[] heights = new double[2];

widths[0] = 660;
for (int j = 0; j < 2; j++)
heights[j] = 2.0;

int index = slide.Shapes.AddTable(0,0,widths,heights);

TableEx pptTable = (TableEx)slide.Shapes[index];

//Inserting row at particular index
pptTable.Rows.InsertClone(pptTable.Rows.Count, pptTable.Rows[0], true);

//Adding row at end of collection
//pptTable.Rows.AddClone(pptTable.Rows[0], true);

pres.Save(“D:\Aspose Data\TestCellIssue.pptx”, Aspose.Slides.Export.SaveFormat.Pptx);

Many Thanks,