We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Simple List Mail Merge Syntax

Thread ID:

Created:

Updated:

Platform:

Replies:

146077 Jul 18,2019 05:18 PM UTC Jul 19,2019 12:00 PM UTC ASP.NET MVC - EJ 2 1
loading
Tags: DocIO
Steve Mumma
Asked On July 18, 2019 05:18 PM UTC

I have a collection of strings that I wish to output to a mail merge document.

Since an item in this list has no child properties, what would be the mail merge syntax to use in the document?

I have tried the following mail merge fields:

<<string_list>>                                                                 outputs System.Collections.Generic.List`1[System.String]
<TableStart:string_list>><TableEnd:string_list>>          no output

Poorani Rajendran [Syncfusion]
Replied On July 19, 2019 12:00 PM UTC

  
Hi Steve,

Thank you for contacting Syncfusion support. 
Queries 
Details 
<<string_list>> outputs System.Collections.Generic.List`1[System.String] 
To merge the list of strings in the Word document using Mail merge functionality, we suggest you to set the MergeFields in  template Word document and then execute mail merge using  Execute(IEnumerable) API. 
<TableStart:string_list>><TableEnd:string_list>> no output 
To merge of list of string in particular group or table in the Word document, we suggest you to set the MergeFields inside the group and then  execute mail merge using  ExecuteGroup(MailMergeDataTable) API.

In your scenario, there is no MergeFields inside the group (<TableStart:string_list>><TableEnd:string_list>>). So, while executing mail merge functionality using DocIO it doesn’t merge the data into the Word document. 

We have prepared a sample application as per your requirements and it can be download from the below link :
https://www.syncfusion.com/downloads/support/forum/146077/ze/MailMerge-820396676

Note: Please find the input Word document template in the “Data” folder of above sample application.
1. “ExecuteTemplate.docx”-Template Word document used to execute mail merge in whole Word document.
2. “ExecuteGroupTemplate.docx”- Template Word document used to execute mail merge for particular group in Word document.

In this sample, we have done following things:
1. Loads the input Word document template.
2. Generate data using the list of string.
3. Executes mail merge in the Word document using  Execute(IEnumerable) API.
4. Executes mail merge for particular group in Word document ExecuteGroup(MailMergeDataTable) API.
5. Saves the Word document.

Please refer the below UG documentation link to know more about working with Mail merge in Word document using DocIO:
https://help.syncfusion.com/file-formats/docio/working-with-mailmerge

Please let us know if you have any other questions.

Regards,
Poorani Rajendran
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon