Hi Shaishav,
From the given details, we have found that the IF field results are not updated
properly in the output document. To achieve your requirement, we recommend you to call the UpdateDocumentFields API after executing mail merge to get the proper results for
all fields in the Word document. Because while calling UpdateDocumentFields API, it updates the field result based on merged field
execution. So we can get proper results for all fields in the Word document.
We have
prepared a sample application to achieve your requirement. It can be downloaded
from the attachment.
In this attached sample, we have done the
following things.
1. Opens the input Word document.
2. Create a data table and executes the mail merge based on that data table.
3. Update the fields in the Word document using UpdateDocumentFields API.
4. Saves the Word document.
Please
refer our UG documentation to know about UpdateDocumentFields API,
https://help.syncfusion.com/file-formats/docio/working-with-fields#updating-fields
Regards,
Anto Nihil S
Attachment:
Mailmerge_e8e4abfc.zip