Extract Range of Cells as HTML or RTF

Hello,

I was wondering if there was a way of extracting a range of cells in HTML or RTF format? I’ve read that your Aspose Words product supports insertion of HTML and RTF, so if I could also extract this out of a spreadsheet this would allow me to paste entire tables into a document easily.

The result I am trying to achieve would be similar to selecting a group of cells in Excel and hitting CTRL-C, then switching to Word and selecting Paste Special->HTML. The result is a nice table in the document where the formatting matches the original cells in the spreadsheet.

Is this possible to do programmatically using your products?

Thanks in advance,
Gary

Hi Gary,

As far as Aspose.Cells for .NET is concerned, I 'm afraid there is no feasible solution available at the moment to insert the range of cells (with style formatting) as a formatted editable (Paste Special - Html) table into word document. I think you may try some alternative options, I am not sure if it suits your need:

1) You can use Aspose.Words for .NET APIs to embed the excel file (having your range of formatted data) as an Ole Object into the word document, check the corresponding / appropriate Aspose.Words for .NET API by yourself.

2) You can use Aspose.Cells for .NET API to convert a sheet to image file and then paste the image into MS Word document using Aspose.Words for .NET API, check the doc topic: http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/converting-worksheet-to-image.html

3) Aspose.Cells for .NET supports to save the excel file to html file format using the API, e.g

workbook.Save("f:\\test\\MyFile.html", FileFormatType.Html);

So, you may check this feature too.

Thank you.