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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Mail Merge - Email field clickable in Word

Thread ID:

Created:

Updated:

Platform:

Replies:

130985 Jun 14,2017 05:44 PM UTC Jun 20,2017 06:08 AM UTC ASP.NET Web Forms 3
loading
Tags: DocIO
AS
Asked On June 14, 2017 05:44 PM UTC

Hi

I am simply creating a Word template that has a couple of merge fields in Word. The data on one of the merge fields is an email address. I am using a simple string array to populate the template using MailMerge.Execute(fieldNames, fieldValues).

This works.

Now I want the generated file to have the email address to be clickable, and to show the email address as the visible text .. the equivalent of HTML <a rel='nofollow' href="mailto:a@a.com">a@a.com</a>

How can this be done? I did see https://www.syncfusion.com/forums/128620/keep-hyperlinks-on-mailmerging but its not quite the same or explained. 

Thanks

Vijay Ramachandran [Syncfusion]
Replied On June 15, 2017 07:02 AM UTC

Hi Sudhir,

Thank you for contacting Syncfusion support.

You can replace merge field with hyperlink (Email ID) by using merge field event. We have prepared the sample to meet your requirement, you can download the sample from here and let us know if it helps.

In this sample, merge field event will trigger during the Mail merge execution. In the event, we have added new hyperlink with the field value (email id) into merge field owner paragraph and removed the merge field from its owner paragraph. Please refer our UG documentation to know about hyperlinks.

Please let us know if you have any concern.

Regards,
Vijay R
 


AS
Replied On June 19, 2017 01:52 PM UTC

Greetings

This is a great start ... thanks for the attachment which provided guidance ... I have a follow-up question that I am not finding a process for in the API reference ...

I have a document with many paragraphs, several paragraphs have mail merge fields in between text. The example provided illustrates how to append to the end of a paragraph and then remove the merge field ... how can I replace the merge field with an email hyperlink ...

Sample text ...

This is text. This is text. This is text. This is text. This is text. This is <<MERGEFIELD>> text. This is text. This is text. This is text. This is text. 

I want to replace the Word merge field with an email hyperlink. The data coming into the merge field is the email address in plain text (a@a.com).

Please advise
Thanks

Vijay Ramachandran [Syncfusion]
Replied On June 20, 2017 06:08 AM UTC

Hi Sudhir,

Thank you for your update.

Yes, you can insert the Email hyperlink field at the place of merge field instead of appending to end of the paragraph. We have prepared the sample to meet your requirement, please find the sample from here and let us know if it helps.

In this sample, we have created hyperlink field using AppendHyperlink method and inserted the hyperlink field into merge field owner paragraph at the index of merge field.

Let us know if you have any concern.

Regards,
Vijay R
 


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.

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

;