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

Free Support Forum - aspose.com

Can we Merge with HTML content


I have a field in my database that contains some HTML code, and I want to merge this field with a template word document.

Do you have a piece of code for me please ?



Thank for your inquiry. Yes, you can achieve this using Aspose.Words. You should use MergeField event handler in this case. Please find an example in the documentation:


Hope this helps.

Best regards.

bad link…consider adding the example here


Thanks for your request and my apologizes for inconvenience. The link was broken after refactoring our documentation some time ago. Here is correct link to this article:


Hope this helps. Please let me know if you need more assistance, I will be glad to help you.

Best regards.

I think the second link is broken too


Thanks for your request. In the latest version of Aspose.Words MailMerge.MergeField event was replaced with the MailMerge.FieldMerging property and MergeFieldEventHandler was replaced with the IFieldMerging interface. The documentation was refactored in accordance to these changes. Please see the following link to learn more about IFieldMergingCallback:


Also, I think this video will be useful for you:


Please let me know in case of any issues. I will be glad to help you.

Best regards,