I came across the “Free-code” offer in Aspose blog. Hope the below description will give a fair idea about my requirement.
Programming language: C#
Preferred Aspose Version: 6.0.1
I have a master document that contains placeholders. The placeholders need to be replaced by the value of Word variables from a supporting document. Here are the properties of Placeholders
- The placeholder will be a text enclosed between
'<%'
and'%>'
.
For Example,<% NAME %>
in Master.doc - The placeholder will be replaced with the content of the variable that has the same name as that of the placeholder. In the above example, the placeholder
<%NAME%>
will be replaced with the content of variable named NAME. - The properties of the placeholder should be retained while replacing the content. For example, if the placeholder is in BOLD, the replaced content should also be in BOLD.
- The placeholders in header and footer also need to be replaced.
There is another placeholder called <%BODY%>
which will be replaced by the content of the supporting document. The properties of the content (not the placeholder) need to be retained while replacing the BODY placeholder.
ATTACHMENTS
- Master.doc
This document contains placeholders - Support.doc
Supporting document that contains variables NAME, DOB, LOCATION, SECURITY_CODE. - Final.doc
This is the desired output after replacing the placeholders. You can notice the font changes in the Final doc.