DocX icon indicating copy to clipboard operation
DocX copied to clipboard

DocX.Load() failed for specific file

Open MosheL opened this issue 5 years ago • 3 comments

Object reference not set to an instance of an object.

Xceed.Words.NET.DocX.PopulateDocument(DocX document, Package package) Xceed.Words.NET.DocX.PostLoad(Package& package) Xceed.Words.NET.DocX.Load(String filename)

I cant upload the file to public as its content is private. How I can play with the file to find the internal problem?

I was tried to edit the file with Word, works Tried to open >save with Word, the file is processed OK. I suspct the origin file, but do not know how to test it.

MosheL avatar Apr 17 '19 10:04 MosheL

Inb4 - "try out the trial version of this etcetc."

wolfgangjt avatar Apr 17 '19 17:04 wolfgangjt

We are facing the same issue and here is a document that fails to load. TC74625.docx

MrDaedra avatar Jun 05 '20 15:06 MrDaedra

Hi MrDaedra, Thank you for reporting this. It will be fixed in v1.8. In the meantime, here's how to fix it. You can: -load a document which contains "docDefaults" (it is not the case in TC74625.docx) -go in file Xceed.Document.NET/Src/Document.cs, in method "PopulateDocument" and make sure the "document._styles.Root.Element( XName.Get( "docDefaults", Document.w.NamespaceName ) )" is not null before getting its "Element( XName.Get( "pPrDefault", Document.w.NamespaceName ) )".

Thank you

XceedBoucherS avatar Jun 08 '20 14:06 XceedBoucherS