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.

MailMerge - how can we control the format of dates?

Thread ID:

Created:

Updated:

Platform:

Replies:

116987 Jul 15,2014 10:10 PM Jul 17,2014 07:27 AM Windows Forms 1
loading
Tags: DocIO
Anthony Consolati
Asked On July 15, 2014 10:10 PM

We are using DocIO to merge a word document which contains a few date fields. The date fields are fed into the merge directly from a datatable. When the merge is executed the dates are merged with the time component (in our case it's 00:00:00 AM).

The problem is we don't want the time component to show up if it's 0. Is there anything we can do to control the formatting or hide the time component if it's 0?


Nithya B [Syncfusion]
Replied On July 17, 2014 07:27 AM

Hi Shamsul,


Thank you for your interest in Syncfusion products.

 

Your requirement to preserve date format or hide time part if time is 00:00:00 AM is achievable using DocIO, while mail merging Word document with date value from a data table.

1.   Define date format for the mail merge field in the input Word template document as below.

          Syntax: { MERGEFIELD “Mergefieldname”  \@ “ DateTime Format” }

          Example: { MERGEFIELD  Date \@ "dd-MMM-yyyy" }

2.   Format the merged date value if time is 00:00:00 AM, on demand while mail merging using mail merge event handler of DocIO. Please refer our UG documentation from the below link for more information regarding mail merge event of DocIO.

UG link:

http://help.syncfusion.com/ug/windows%20forms/documents/mailmergeevents.htm

We have prepared sample to illustrate the above mentioned solutions while mail merging using DocIO. Please do find the attached sample and let us know this helps you.

 

Please let us know if you have any other questions

 

Regards

Nithya


Attachment: Sample_MailMegeWithDateTime_51d6c256.zip

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.

;