open xml power tool throwing an error Value cannot be null. Parameter name: part

19 views Asked by At

When I open new file in browser using DocumentFormat.OpenXml dll, it is opening properly but when I do any change and save it. after that the I am facing below error.

First I open the doc file using DocumentFormat.OpenXml dll and after that I am converting html text to readable text but getting error. Below is my code.

enter image description here

Getting error on below line

XElement html = OpenXmlPowerTools.HtmlConverter.ConvertToHtml(doc, settings);

Error:

enter image description here

I have checked for parts while debugging i found below parts are missing when I open fresh file and after the file is saved.

  1. documentSettingPart
  2. FontTablePart
  3. NumberingDefinitionPart
  4. ThemePart
  5. WebSettingPart

Is that above issue is occurring because the parts are missing or anything else?

0

There are 0 answers