Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Mar 29, 2023 3:44 pm

as in https://www.e-iceblue.com/Tutorials/Spi ... B.NET.html

Code:

Document doc = new Document();
doc.LoadFromFile("aa.docx");
doc.InsertTextFromFile("bb.docx", Spire.Doc.FileFormat.Docx);
doc.InsertTextFromFile("cc.docx", Spire.Doc.FileFormat.Docx);
doc.SaveToFile("out.docx", Spire.Doc.FileFormat.Docx);

error

[ArgumentException: L'elemento è già stato aggiunto. Chiave nel dizionario: '/word/webextensions/taskpanes1.xml'. Chiave aggiunta: '/word/webextensions/taskpanes1.xml']
System.Collections.SortedList.Add(Object key, Object value) +12517320
spr권.䀭(spr곗 A_0) +98
spr갢.䀭(spr곗 A_0, String A_1, String A_2, String A_3, String& A_4) +71
spr츗.䆗() +372
spr츗.䀭(sprḅ A_0) +248
spr츗.䀭(Document A_0, Stream A_1) +117
spr츗.䀭(Document A_0, String A_1) +79
Spire.Doc.Document.䫈(String A_0) +52
Spire.Doc.Document.SaveToFile(String fileName, FileFormat fileFormat) +170
IricavAcque.Mensile.bntCreaMensile_Click(Object sender, EventArgs e) +2690
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9847130
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +211
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1696

Product version
Spire Doc 11.3.1

silvano.laboranti
 
Posts: 4
Joined: Thu May 24, 2018 7:44 am

Thu Mar 30, 2023 7:16 am

Hi ,

Thanks for your feedback.
I did reproduce your issue after testing your files. I have logged this issue into our tracking system with the ticket SPIREDOC-9231, our Dev team will do further investigation and fixing. Once there is any update, we will keep you informed. Sorry for the inconvenience caused.In addition, I also tested the following code, it could merge successfully .
Code: Select all
            //Create word document
            Document document = new Document();
            document.LoadFromFile(@"aa.docx", FileFormat.Doc);

            Document documentMerge = new Document();
            documentMerge.LoadFromFile(@"bb.docx", FileFormat.Docx);

            Document documentMerge1 = new Document();
            documentMerge1.LoadFromFile(@"cc.docx", FileFormat.Docx);

            foreach (Section sec in documentMerge.Sections)
            {
                document.Sections.Add(sec.Clone());
            }

            foreach (Section sec in documentMerge1.Sections)
            {
                document.Sections.Add(sec.Clone());
            }

            //Save as docx file.
            document.SaveToFile("Sample.docx", FileFormat.Docx);

You can try this way on your side firstly. If you have any questions after the test, please feel free to contact us.

Best Regards,
Herman
E-iceblue support team
User avatar

Herman.Yan
 
Posts: 115
Joined: Wed Mar 08, 2023 2:00 am

Mon Apr 10, 2023 10:32 am

Hi,

Thanks for your patience!
Glad to inform you that we just released Spire.Doc.11.4.0 hotfix which fixes the issue with SPIREDOC-9231.Please download the new version from the following link to test.
Website link:https://www.e-iceblue.com/Download/download-word-for-net-now.html
link:https://www.nuget.org/packages/Spire.Doc/11.4.0

Best Regards,
Herman
E-iceblue support tea
User avatar

Herman.Yan
 
Posts: 115
Joined: Wed Mar 08, 2023 2:00 am

Return to Spire.Doc