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?

Hi

<?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);

doc.Save(@"Test001\out.doc");

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

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/category1188.aspx

Best regards.