I am reading a Html File, and I want to convert it to a Word File.
I am using this code:
- Code: Select all
Document docHTML = new Document();
docHTML.LoadHTML(new StreamReader("example.html"), XHTMLValidationType.None);
docHTML.SaveToFile("htmlToWord.doc", FileFormat.Doc);
and this code too:
- Code: Select all
Document docHTML = new Document();
docHTML.LoadFromFile("example.html", FileFormat.Html, XHTMLValidationType.None);
docHTML.SaveToFile("htmlToWord.doc", FileFormat.Doc);
but the Word File is not with the correct format. You can see it in the two attachments uploaded.
The Word File have a lot of line breaks.
Can you help me to solve this problem?
I want the Word File format to be the same as the Html format.
Sincerely
Fernando.