Send parameter to doc

hi,
for example
i have a doc with below sentenses :

"your id is =ID , tanx "
“PIC”

i want sent user id and user Pic to doc and replace with ID, and PIC

Hi Morteza,

Thanks for your query. You can achieve your requirement by using Mail Merge feature. Please use the following code snippet to fill document with ID and image. Please read Mail Merge documentation for further detail. I have attached the sample doc file and FileToByteArray code in attachment.

Document doc = new Document(MyDir + "DemoMailMerge.doc");
doc.MailMerge.Execute(new string[] { "ID", "Logo" }, new object[] { "1001", FileToByteArray("d:\\Chrysanthemum.jpg") });
doc.Save(MyDir + "DemoMailMerge-Out.doc");

Hi Morteza,

Thanks for your inquiry. In your case, you can use the MailMerge feature of Aspose.Words. I hope you can achieve what you need after reading the articles suggested below:
https://docs.aspose.com/words/java/mail-merge-and-reporting/

Please let us know if you need more information, we are always glad to help you.

Best Regards,