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

MailMerge - how can we control the format of dates?

Thread ID:





116987 Jul 16,2014 02:10 AM UTC Jul 17,2014 11:27 AM UTC WinForms 1
Tags: DocIO
Anthony Consolati
Asked On July 16, 2014 02:10 AM UTC

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 11:27 AM UTC

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:


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




Attachment: Sample_MailMegeWithDateTime_51d6c256.zip


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