We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Problem with GetFieldNames() and complex date formatting

Hi. I am receiving some odd behaviour from the following line of code in my application -

string[] arrFields = objMailMergeDocument.MailMerge.GetFieldNames();

It appears as if merge codes which contain comlpex date formatting in the merge code do not get picked up correctly. They are being resolved as '' (empty string) as apposed to the correct name.

The merge codes it is having trouble with are -

{MERGEFIELD \@ "dddd" "ASSETS_DATE07" }

{MERGEFIELD \@ "d" \* Ordinal "ASSETS_DATE07"}

{MERGEFIELD \@ "MMMMyyyy" "ASSETS_DATE07"}

In this example, ASSETS_DATE07 is a datetime field returned from a database. The overall goal is the have the date formatted to something like 'Friday the 8th of February 2008' (hence the same code merged 3 times with different formatting). Is there a better way to handle this in the document or am i using the method incorrectly?

Any assistance would be greatly appreciated. Thanks in advance.

Hi

Thanks for your inquiry. Could you please attach your template and provide me your code? I will investigate this and try to help you.

Best regards.