Free Support Forum - aspose.com

Case Sensitive Mail Merge

In your documentation it states under the section for doing simple mail merges, and passing in a pair of arrays:
"Field names are not case sensitive. If a field name that is not found in the document is encountered, it is ignored."
But in my testing, the merge process seems to be case sensitive. It ignores fields if the sensitivity is not exact when I pass in an array. Is this a bug?

Thank You,
Derek Hart

One more question on this. If it is case sensitive, and there is no way around it, can I add add an event such as:

AddHandler doc.MailMerge.MergeField, AddressOf HandleMergeField

and interrupt the process to force the merge field and the field I am passing in to be the same case?

Derek Hart

Great you have noticed it. It's indeed a bug in the implementation of this particular overload of MailMerge.Execute which we were not aware of yet.

All overloads of MalMerge.Execute should be case insensitive . But current implementation of MalMerge.Execute(string[], object[]) is case sensitive. I have logged this problem to our defect base as issue #1166. We will probably fix it in our next release.

Thank you,

No, using MergeField event won’t help you in this case. The event is fired only if the field name is matched.

When do you think the next release will be out. And this is definitely not solvable in my code, right?

The next release will be published in 1-2 weeks.

Please note that other overloads of MailMerge execute are case insenitive and are working correctly. To work around you can construct a DataTable from your field name/value arrays and feed it to MailMerge.Execute.

Do you have a date set for the release that fixes this case sensitive problem?

Derek Hart

The next release is plannned for the beginning of the next week. The fix will most probably be there.

The issue is fixed in Aspose.Words 4.0. All overloads of MalMerge.Execute are case insensitive now.