I’m using nested IF-MergeFields in a document which contain Mail Merge Fields. Although I’m calling Document.UpdateFields before saving the document, the MergeFields are not updated when opening the document.
After updating all fields in the document within Word, everything is shown as expected.
I’ve attached the template I’m using. Below is the code I’m using to execute the MailMerge.
// Open document
var doc = new Document("IfMergeFields.docx");
// Execute MailMerge
doc.MailMerge.Execute(new string[]
{
"Count"
}, new object[]
{
2
});
// Update fields in document
doc.UpdateFields();
// ...save it
doc.Save("IfMergeFields_out.docx");