MailMerge with custom collection

Hi,

Is there any solution to make a MaileMerge with a string List ?

I have found how to execute with string[] (headers) and object[] (datas) but it's limited to 1 row.

I need something like :

string[] lHead = new string[] {"Name", "City"};

List lData = new list() { new string[] {"Martin", "Paris"}, new string[] {"John", "London"} };

doc.Mailemerge.execute(lHead, lData);

Thanks.

Hi,


Thanks for your inquiry. Sure, you can perform a mail merge operation for a single record, from a DataTable, IDataReader or from a DataView depending on your needs. Please refer to the following section of the documentation which outlines everything you need to know about different overloads of MailMerge.Execute method:
http://www.aspose.com/docs/display/wordsnet/Execute+Method

Best regards,

Thanks but you don't aswer to my question.

I asked for mailmerge with list of custom object (a class) or a string collection, not a datatable. My datas don't come from a base.

Thanks.

Hi,


Thanks for your inquiry. In this case, you need to implement IMailMergeDataSource interface to allow mail merge from a custom data source, such as a list of objects. I believe, you can achieve this after using the code mentioned in the attached example. Please let me know if I can be of any further assistance.

Best regards,