In version 8.2.1 of Aspose.Words, we were able to perform an ExecuteWithRegions on an empty data table, and it would render as expected (no rows, and no merge fields showing). As of 9.1 (including 9.3), the merge tokens are not getting cleared.
I’ve attached an example app & word document. If you add an Aspose 8.2.1 reference, you’ll find that the merge tokens go away, as expected. If you add a 9.1 reference, they remain after a merge with an empty table.
Hi Keith,
Thanks for your inquiry.
You are absolutely correct, the behaviour of removing non merged regions appeared in older versions but was removed starting in 9.1. We have had other requests regarding this issue and realise that some customers use this functionality to remove any unused regions from their documents. We will look into supporting this again in a future verison. Your request has been linked and you will be notified of any developments.
In the mean time you can use this class that I wrote for other customers with same request. It is attached to this post, and you invoke it after merging like this:
actually, I have to take that back. It works great when merging one table. But when there are multiple tables on the word template, we’re finding that tables which should have data are also cleared. For now, we’re reverting to 8.2.1. Please let us know if you have any updates or advice.
Hi,
We are running Aspose.Words for .NET version 10.3.0.0, specifically the net1.1 DLL. It would appear as though this fix did not make it into this DLL as an empty table still leaves the definition row in the Word table.
Thanks,
Will SKou