We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Fill table in word

hello, I have a document with a table that has already been created in MSOfficeWord, how i filling their cells with Aspose. and how insert new rows in the this table?

Thank you.


Hi there,

Thanks for your inquiry.

how i filling their cells with Aspose

You can use DocumentBuidler.MoveToCell method to move cursor to the beginning of the cell and write the text. Please check following code example for your kind reference.

// Open document and create

Document doc = new Document(@"Test001\in.doc");

DocumentBuilder builder = new DocumentBuilder(doc);

// move builder cursor to the beggining of the first cell of the first table.

builder.MoveToCell(0, 0, 0, 0);

// Insert some text.

builder.Write("This is text at the begginng of the cell");

// Save output document.



and how insert new rows in the this table?

Please use the following code example to
insert row at the end of table. Hope this helps you.

Document doc = new

// Retrieve the first table in the document.

Table table = (Table)doc.GetChild(NodeType.Table, 0, true);

// Clone the last row in the table.

Row clonedRow = (Row)table.LastRow.Clone(true);

// Remove all content from the cloned row's cells. This makes the row ready for

// new content to be inserted into.

foreach (Cell cell in clonedRow.Cells)



// Add a blank paragraph to the cell.

cell.AppendChild(new Paragraph(doc));

// Add the text.

cell.FirstParagraph.AppendChild(new Run(doc, "cellText"));


// Add the row to the end of the table.