SR 0.822.720.5.IT.ORG.docx (52.4 KB)
Dear all,
Since we introduced the latest version of Aspose.Words for .NET, version 25.4, we have a problem while executing a mailmerge operations on some documents but not all.
For example Aspose.Words enters an endless loop with the attached document (SR 0.822.720.5.IT.ORG.docx).
Investigation the case, I discovered that the text in the article 6 was a problem:
1. Il Direttore generale dell’Ufficio internazionale del lavoro notificherà a tutti i membri dell’Organizzazione internazionale del lavoro la registrazione di tutte le ratificazioni e disdette che gli saranno comunicate dai membri dell’Organizzazione.
2. Notificando ai membri dell’Organizzazione la registrazione della seconda ratificazione che gli sarà stata comunicata, il Direttore generale fermerà l’attenzione dei membri dell’Organizzazione sulla data dell’entrata in vigore della presente convenzione.
I deleted these paragrahs an re-created them. Then it works without any problem (see file SR 0.822.720.5.IT.NEW.docx).
SR 0.822.720.5.IT.NEW.docx (52.7 KB)
It’s really strange as this document / part of document has no merge field.
In the past we already experienced this kind of problem but with some (dirty) footnotes.
Best regards
Jean-Louis Morard
@jlmorard
It seems that you are experiencing an issue with an endless loop during a mail merge operation using Aspose.Words for .NET, particularly with the document you attached. This problem appears to be related to specific text in the document that does not contain any merge fields.
From your description, it seems that the problematic paragraphs were causing the mail merge to hang, but after you deleted and recreated those paragraphs, the mail merge operation worked correctly. This suggests that there might be some underlying formatting or hidden elements in the original text that are causing the issue.
Here are a few suggestions to troubleshoot and potentially resolve the issue:
-
Check for Hidden Characters: Sometimes, documents may contain hidden characters or formatting that can interfere with processing. You can try copying the text into a plain text editor and then back into a new Word document to remove any hidden formatting.
-
Update to the Latest Version: Ensure that you are using the latest version of Aspose.Words, as updates often include bug fixes and improvements that could resolve such issues.
-
Simplify the Document: If possible, simplify the document by removing complex formatting or elements that are not necessary for the mail merge. This can help identify if a specific element is causing the problem.
-
Use MailMerge Callbacks: Implementing a mail merge callback can help you monitor the merging process and potentially catch any issues as they occur. This can provide more insight into what might be causing the endless loop.
-
Contact Support: If the issue persists, consider reaching out to Aspose support with the problematic document and a detailed description of the issue. They may be able to provide more specific guidance or identify a bug.
If you have any further questions or need additional assistance, feel free to ask!
We use the latest version of Aspose.Words (2025.4), there are no different hidden cahracters in the 2 documents. That should be something with the undelying structure in the word document.
@jlmorard Could you please provide a simple code and data that will allow us to reproduce the problem on our side? I have tested with dummy data and the latest 25.5 version of Aspose.Words and cannot reproduce the problem on my side:
Document doc = new Document(@"C:\Temp\in.docx");
doc.MailMerge.Execute(new string[] { "SR_Nummer", "Standd" }, new string[] { "SR_Nummer", "Standd" });
doc.Save(@"C:\Temp\out.pdf");
@alexey.noskov I had not enough time today to elaborate a code that demonstrates this problem but I can give you the following informations:
-
The processing has no problem till version 25.1.0 of the Aspose.Words library. Since version 25.2.0 there is a problem (also with 25.5.0).
-
The mailmerge operation executes without any problem until the IMailMergeDataSource.MoveNext() returns false (until there is no more data to process). In my service I run the processing with my own implementation of the IMailMergeDataSource interface:
builder.Document.MailMerge.Execute(new XMailMergeDataView(Datasource, Parameters, builder, buildingBlocks, dataSpec));
Next step: I will try to provide a sample code.
@jlmorard Tank you for additional information. We will wait for the sample code that will allow us to reproduce the problem.