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

Free Support Forum - aspose.com

Read Word Document Table into Excel

Hi

I need to read a word document table and draw the same table into excel is this posible in aspose,if possible send me the code

Regards

Ajeesh M J

Hi Ajeesh,


Thanks for your inquiry.

I think, in this case, you first need to read Word table into DataTable and then somehow generate Excel document from that DataTable. Using Aspose.Words you can create a DataTable from a table in the document. I’m afraid we don’t have any specific sample code for this, but if you take a look at this following page you will see the reverse (a Datatable to Table) so you can get a similar idea here:
http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/howto-build-a-table-from-a-datatable.html

Once, you read your Word table into DataTable, you can use the following article to generate Excel document:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/aspose.cells.cells.importdatatable_overload_2.html

Moreover, you can also convert whole Word document to Excel by using Aspose.Words+Aspose.Cells e.g:

Document doc = new Document(“C:\Temp\sample.doc”);<o:p></o:p>

ConverterDoc2Xls converter = new ConverterDoc2Xls();<o:p></o:p>

Workbook wb = converter.Convert(doc);<o:p></o:p>

wb.save(“C:\Temp\out.xls”);


I have attached the ConverterDoc2Xls.zip file.

If we can help you with anything else, please feel free to ask.

Best Regards,