Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Jul 28, 2022 2:29 pm

Hello,

I tried FreeSpire.Doc in order to be able to transform HTML file into Docx file.

I tried to do the same code as we can find on the tutoriel :

Document document = new Document();
document.LoadFromFile(@"C:\Users\ThomasFABRE\Documents\rapportChantier.html", FileFormat.Html, XHTMLValidationType.None);
string res = @"C:\Users\ThomasFABRE\Documents\rapportChantier2.docx";
document.SaveToFile(res, FileFormat.Docx);

But when I do that I have the error : 'Object reference not set to an instance of an object.' But my file does exist and when I try to open a docx file in the same root, I can open it.

What shall I do in order to open this file ?

Best regards,
Tfabre

tfabrecomin
 
Posts: 1
Joined: Thu Jul 28, 2022 2:22 pm

Fri Jul 29, 2022 6:38 am

Hello Thomas Fabre,

Thanks for your message.
I tested your file and found the same error as yours. However, even I opened your input Html using Microsoft Word, I also got an error as shown in the attached screenshot. Since our Spire.Doc is based on the Microsoft Word, sorry our product also was unable to be compatible with this error of the document itself. Thus, I suggest you check your HTML document firstly. If there is anything else we can do for you, just feel free to let us know.

Sincerely,
Simple
E-iceblue support team
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Wed Aug 03, 2022 9:03 am

Hello Thomas Fabre,

Could you please let us know how is your issue going? Thanks in advance for your feedback and time.

Sincerely,
Simple
E-iceblue support team
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Return to Spire.Doc