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

Free Support Forum - aspose.com

Conditional MergeFields

Trying to insert text into a document based on a value of a mergefield.

Seems I can get it working using the mergefield as both the field to compare and the value to compare, but can't seem to get it to work comparing a mergefield to text.

See template and generated instance attached.

Anyone have an ideas?


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

Thanks for your request. This works as expected on the latest version of Aspsoe.Words. I use the following code for testing:

Document doc = new Document(@"Test001\in.doc");

string[] names = { "Activity_StatusChangeApproved", "Activity_Id" };

object[] values = { "Yes", 134598 };

doc.MailMerge.Execute(names, values);


You can download the latest version of Aspose.Words from here:


Best regards.