How to copy a formatted cell in Excel to a table cell in Word using .NET?

Posted by Harry Nath on Stack Overflow See other posts from Stack Overflow or by Harry Nath
Published on 2010-04-20T01:46:07Z Indexed on 2010/04/20 1:53 UTC
Read the original article Hit count: 329

Filed under:
|
|
|

I'm attempting to copy cells, one at a time, from an Excel 2003 (or 2007) spreadsheet to a Word 2003 (or 2007) table. I'd like the code to be version-agnostic, and so am using late binding. The formatting of the contents of the Excel cell, such as color, underline, strike-through, needs to be preserved. My approach is to use a Word doc as a template. It has a table at the top which I can copy to the end of the doc, add rows as needed, and fill in the word table cells with the data from the excel spreadsheet. Unfortunately, all the formatting disappears. All I get is the text itself.

© Stack Overflow or respective owner

Related posts about excel

Related posts about word