Here is the code (simplified from here):
- Code: Select all
public void moo()
{
var filename = @"test.docx";
var doc = new Document(filename);
doc.SaveToFile("temp.docx", FileFormat.Docx);
var wmlDoc = new WmlDocument("temp.docx");
var source = new Source(wmlDoc);
var newDoc = OpenXmlPowerTools.DocumentBuilder.BuildDocument(new List<Source> {source});
}
Test.docx is attached (zipped). The error I see is "Sequence contains no elements". This code works fine if I create the WmlDocument directly from "test.docx" instead of "temp.docx". It also works if I remove the numbered list.
I'm going to run a comparison of test.docx and temp.docx to see what changes have been made by Spire.doc but wanted to see if anyone had some insight while I'm doing that.