How to convert Html into Word document

Hi,

I am working on application where I need to convert Html file/string into Word. Can you please provide some code snippets? I couldnt find any code for this in your API.

S

Converting HTML file to Word:

Document doc = new Document(@"c:\Test.html");

doc.Save(@"c:\Test.doc", SaveFormat.FormatDocument);

Converting HTML string to Word:

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

builder.InsertHtml(@"

List:

  • Item1
  • Item2
");

doc.Save(@"c:\Test.doc");

Best regards,

1 Like