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.
Unfortunately, activation email could not send to your email. Please try again.

DOCIO - mail merge help

Thread ID:

Created:

Updated:

Platform:

Replies:

74222 Jun 3,2008 07:25 PM Jun 5,2008 08:11 AM ASP.NET Web Forms (Classic) 3
loading
Tags: DocIO
Jerry Monteiro
Asked On June 3, 2008 07:25 PM

i'm trialling DOCIO and was wondering if you have the vb.net code for the following scenario:

We have hundreds of MS Word Documents with 10 merge fields already setup, these merge fields are placeholders for data stored in SQL Server.

We have a grid which users use to select the records/information they want to merge, unlike your standard mail merge process where only 1 Template is used to merge the data (eg like a letter mailout scenario), we have many Word Template documents. The Word Document File Name is unique and specific, every data row that is to be merge will have this file name. So essentially I need a component to read the records the user has selected, find the Word file on the server and merge the data in the merge fields and perform this process for every record the user has selected, then combined all of the merged documents into 1 Word File for them to either print to hardcopy, view in broswer or they may wish to print to PDF.




Bhuvaneswari P [Syncfusion]
Replied On June 4, 2008 09:30 AM

Hi Jerrym,

Thank you for your interest in Syncfusion products.

Yes, it is possible to merge the selected record from the Grid control to the corresponding template document merge field. Then we can merge those generated document using ImportContent() method.

Here is the sample for your reference:

http://websamples.syncfusion.com//samples/DocIO.Windows/F74222/main.htm


Sample description :
1. Click the any record from the Grid control
2. This will match the corresponding record in the template folder
3. Then it will merge the record field value in the template document fields
4. Goto Step1[For more record selction and merge fields]
5. Now click the button "Merge document"
6. This will merge all the documents in the output folder

Please let try this and let us know this meets your requirement.

Best Regards,
Bhuvana



Jerry Monteiro
Replied On June 4, 2008 06:12 PM

Hi

is there a property in the Mail Merge class to automatically map data fields to the ms word merge field names?

>Hi Jerrym,

Thank you for your interest in Syncfusion products.

Yes, it is possible to merge the selected record from the Grid control to the corresponding template document merge field. Then we can merge those generated document using ImportContent() method.

Here is the sample for your reference:

http://websamples.syncfusion.com//samples/DocIO.Windows/F74222/main.htm


Sample description :
1. Click the any record from the Grid control
2. This will match the corresponding record in the template folder
3. Then it will merge the record field value in the template document fields
4. Goto Step1[For more record selction and merge fields]
5. Now click the button "Merge document"
6. This will merge all the documents in the output folder

Please let try this and let us know this meets your requirement.

Best Regards,
Bhuvana





Bhuvaneswari P [Syncfusion]
Replied On June 5, 2008 08:11 AM

Hi Jerrym,

Thanks for the update.

I am not understand about your requirement. Please let me know if your requirement is one the below cases.

1. Case 1:

Is your intention to automatically map between names of fields in your data source and names of mail merge fields in the document

2. Case 2:

If your intension to map particular field in the document and merge with some value. In that case please use the below code snippet:

WordDocument doc = new WordDocument(@"..\..\mailmerge.doc");
string[] fieldname={"FirstName","SecondName"};
string[] fieldvalues={"John","David"};
doc.MailMerge.Execute(fieldname, fieldvalues);


Sample reference:

http://www.syncfusion.com/development/uploads/MapField_34bcb025.zip


If this is not your case then please update us with more details and template document to understand the issue clearly and provide you an solution.

Best Regards,
Bhuvana



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.

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.

;