Open Office xml SDK exception “Cannot insert the OpenXmlElement ”newChild“ because it is part of a tree”
问题 I am generating a a word document using open office sdk 2.0. I am getting an exception with is "Cannot insert the OpenXmlElement "newChild" because it is part of a tree." I am aware that is exception is due to trying duplicate nodes within the xml but I am not sure how to fix it. private void GenerateWord(string Path) { using (WordprocessingDocument WpDoc = WordprocessingDocument.Create(Path, WordprocessingDocumentType.Document, true)) { MainDocumentPart MainPart = WpDoc.AddMainDocumentPart()