I use the following code when “finalizing” the document (before the result is saved to output file) just to make some custom field merging and to remove some garbage (unused merge fields and empty stuff):
document.MailMerge.FieldMerging += MailMerge_FieldMerging;
document.MailMerge.ClearOptions = MailMergeClearOptions.RemoveUnusedFields |
MailMergeClearOptions.RemoveEmptyTableRows |
MailMergeClearOptions.RemoveEmptyRanges |
MailMergeClearOptions.RemoveEmptyParagraphs;
document.MailMerge.Execute(new string[] { string.Empty }, string.Empty);
So far I was using GemBox 3.1 v1134 and everything was working fine.
Now I would like to upgrade to the latest version. The problem is that the formula field that was remaining before is being removed now. I noticed the support for formulas has been added in version 3.1 v1197.
How can I force the code in MailMerge_FieldMerging to not remove the formula but to clear everything else as before?
I already wrote a prototype. Just tell me in case it would help to attach it.
Thanks and regards
Lukas