Free Support Forum - aspose.com

Merge Field with IF statement needs to be refreshed to display correct info

I have this weird problem that i hope someone can help me solve:

merge field reads as follows:

{ if { mergefield JOB } = "PRO" "$10,000.00" "$3,000" }

When i run Aspose.MailMerge.Execute(filename) the document displays $3,000 for all the records ,"PRO" and not "PRO"

If i right-click in word on the field and choose "Update Field" it refreshes and displays correctly.

Is this a bug in ASPOSE/WORD? is there a solution? Can i refresh merge fields somehow without using word objects?

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for your interest in Aspose products. Unfortunately, conditional logic is not supported by Aspose.Words. Aspose.Words doesn’t evaluate IF fields. See FAQ for more information. As workaround you can move your conditional logic into your SQL query or into MargeField event handler.

Best regards.