I am facing an issue while attempting to import a StructuredDocumentTagRangeStart
node into the document. Whenever I try to perform this operation, I encounter an error that prevents the successful import of the node and getting “A value with the specified key has already been added” error for “StructuredDocumentTagRangeStart” node type.
@bhavikahirr Could you please attach your input documents along with code that will allow us to reproduce the problem? We will check the issue and provide you more information.
@bhavikahirr Unfortunately, I cannot reproduce the problem on my side using the latest 23.7 version of Aspose.Words. If possible could you please create a simple console application that will allow us to reproduce the problem on our side. I have tried with your simplified code, since I cannot run your original code on my side. Also, I have tested with the following code, that imitates a simplified scenario:
Document doc = new Document(@"C:\Temp\in.docx");
Document dst = (Document)doc.Clone(false);
// Put the section from the source document to retain original section page setup.
dst.AppendChild(dst.ImportNode(doc.LastSection, true));
// Remove all children from the impirted section.
dst.FirstSection.Body.RemoveAllChildren();
List<Node> nodes = doc.GetChildNodes(NodeType.Any, true)
.Where(n => n.NodeType == NodeType.StructuredDocumentTagRangeStart || n.NodeType == NodeType.StructuredDocumentTagRangeEnd)
.ToList();
foreach (Node node in nodes)
dst.FirstSection.Body.AppendChild(dst.ImportNode(node, true));
dst.Save(@"C:\Temp\out.docx");
Console Application:
https://shaligraminfotech0-my.sharepoint.com/:u:/g/personal/bhavik_a_shaligraminfotech_com/EQXX4GuS6utLiAm6_eBLGwEBPqqi1aT2Dt5QS6C7nJmm7g?e=9KYEDv
@bhavikahirr Thank you for additional information. We will investigate the problem and provide you more information.
@bhavikahirr
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): WORDSNET-25758
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
The issues you have found earlier (filed as WORDSNET-25758) have been fixed in this Aspose.Words for .NET 23.12 update also available on NuGet.