MergeFieldEventHandler doesn't work with ExecuteWithRegions after use with Execute, and vice-versa. For example:
// Setup mail merge event handler & document builder to do the custom work.
doc.MailMerge.MergeField += new MergeFieldEventHandler(MergeFieldProcess);
mBuilder = new DocumentBuilder(doc);
// Do the standard merge without regions.
foreach (string name in tablesToExecute)
{
currentTable = ds.Tables[name];
doc.MailMerge.Execute(ds.Tables[name]);
}
// Do the merge with regions.
foreach (string name in tablesToExecuteWithRegions)
{
currentTable = ds.Tables[name];
doc.MailMerge.ExecuteWithRegions(ds.Tables[name]);
}
In this case, MergeFieldProcess is called for Execute, but not for ExecuteWithRegions. If I do my ExecuteWithRegions first, then do Execute, same problem but reversed. I've tried setting up the event handler again and reinitializing the DocumentBuilder a second time, but that doesn't work either.
Am I doing something wrong? Does anyone have a solution / workaround to this problem?
Thanks!!!!
This message was posted using Aspose.Live 2 Forum