Free Support Forum - aspose.com

How to attach a data source to a word document programmatically?

Do Aspose have any method equivalent to the following Word document API.
Document.MailMerge.OpenDataSource()?

My requirement is to bind a mail merge data source to an existing Word document programmatically.

Thanks.!


Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. You can execute mail merge using Aspose.Words. Please see the following link to learn more:

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/perform-mail-merge.html

You should parse you text document, get data from it, and execute mail merge. If you need, I can try to create sample code for you. If so, please attach your template and sample data source (txt file).

Best regards.

I am sorrry… may be I didn’t explain the whole issue.

Currently I do use Aspose for Mail Merge.
My current issue is on how to display the custom merge fields to the user.
ie, when the user clicks on “Insert merge Fields” on Word, I want to make the pre-defined merge fields available to the user.
To achieve this, I am using the following technique.

Have a TXT file that contains the required merge field names and another line that has empty string values for these fields. Please find the sample attached along with.
Now when create/open a document, click on “Open Data Source” button on Mail-merge toolbar. After this, if you click the “Insert Merge Field” button, you will find the predefined fields that are defined in the d ata source in the previous step.

Now when I create a new document template, I want to attach this empty datasource programmtically so that the user is being provided with the predefined fields.
Does Aspose Words provide any way to do this operation programmatically?

Please let me know if you have any clarification.



Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. Unfortunately, there is no way to attach a mail merge data source to Word document using Aspose.Words. This is the known issue #5170 in our defect database.

Best regards.

Thanks for the reply.
This bug is very critical for us because we are going to use the Word Object Library API to get the work done. Using Word on the server side has many know issues.
Can I know of any ETA set for this bug?
…Or can I get a notification, once this bug is fixed and released?


Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Unfortunately, I cannot provide you any reliable estimate regarding this issue at the moment. I will notify you as soon as it is fixed.

Best regards.

The issues you have found earlier (filed as 5170) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(108)