Is it possible to do mail merge like ms word using Datasource. Once I have linked to the specific DB. Whenever I open the document it finds the DB and update the fields.
But using your component I can just mail merge with DB once opened the fields are merged, but its not reference to the DB. So if change the data in the database it will not reflect in the second time opening the document.
Please let me know how to do like ms word datasource linking?
For this I don’t want to run the application each time.
Thanks for your request. Unfortunately, there is no way to link document to Mail Merge DataSource using Aspose.Words. This is logged in our defect database as feature request #5170.
You can only perform Mail Merge using Aspose.Words programmatically as described here: https://docs.aspose.com/words/java/mail-merge-and-reporting/
Best regards.
I see that Feature request #5170 was ‘solved’ in an update, but can you give some example code on how to link a Word document to an existing datasource for mailmerge without the actual ‘Generate’?
I would like to give my users a document that has been linked to a datasource, with the correct mergefields in the document, but not yet generated so the user can manually alter some text before selecting in Word the ‘Merge to…’ option.
Thanks for your inquiry. For example, you can connect an Excel spreadsheet as an external data source to your input Word template document via the Dynamic Data Exchange (DDE) system by using the code something like below:
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.