OfficeDev / Open-Xml-PowerTools

MIT License
692 stars 26 forks source link

Error: Sequence contains no elements when running DocumentBuilder on a server #234

Closed DeuteriumCore closed 5 years ago

DeuteriumCore commented 6 years ago

However, when I run part of the code that merges two documents on my computer, it works fine. Any help? Thanks!

Here is the code: `using (WordprocessingDocument wDocIn = WordprocessingDocument.Open(mem, false)) using (WordprocessingDocument wDocTemplate = WordprocessingDocument.Open(mem2, false)) { List sources = new List();

                WmlDocument wmlIn = new WmlDocument("", mem);
                WmlDocument wmlTemplate = new WmlDocument("", mem2);

                sources.Add(new Source(wmlIn, true));
                sources.Add(new Source(wmlTemplate, true));

                wmlIn = DocumentBuilder.BuildDocument(sources);

                Output = wmlIn.DocumentByteArray;
            }`

Unfortunately, I cannot debug the program uploaded on the server since it's . . . OutSystems.

tomjebo commented 5 years ago

Closing all issues as this repo is being archived and will no longer be maintained by Microsoft. The project is licensed for continued use and development by forking to your own repo.