I have to find a way to generate a string so that when set and then pasted to a Word document it will display a table.
I did some research about this, but non of them seem to work. One of the things i tried was to generate a string of html , then setting it as the clipboard data and passing format as html.
string html = @"<html><body><table> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table></body></html>"; Clipboard.SetData(DataFormats.Html, html);
but it did not work, nothing was pasted to word doc when i tried. And then when i set Data format as text (DataFormats.Text) it was pasted but only as text , not as a table.
Hoping for some help
Thanks in advance!
Check the Answers