Aspose Words not honoring if statements in templates

I used the following code with the attached document. The fields are replaced, but the if statements are not honored.


Document doc = new Document(“C:\Users\XXXX\Documents\MailMergeTest\TestTemplate.docx”);
String[] fieldNames = new String[] {“First_Name_D”, “Last_Name_D”, “Middle_d”, “Last_Name_Ext_D”};
Object[] fieldValues = new Object[] {“Frank”, “Tank”, “The”, “5th” };

// Execute the mail merge.
doc.getMailMerge().execute(fieldNames, fieldValues);
doc.updateFields();
doc.updatePageLayout();
doc.save(“C:\Users\XXXX\Documents\MailMergeTest\DocumentMerged.docx”);

The problem here was a short circuit between the keyboard and chair. I had to hit alt F9

Hi there,


Thanks for your inquiry. It is nice to hear from you that your problem has been solved. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.