How to validate date in mail merge

I am printing / e-mailing few letters everyday via facility of mail merge in MS Word. I have database in MS Excel with date against each record.

 

I want to print / e-mail (through mail merge) only those letters, which are having today's date.

 

How can I validate date in MS Word before printing / e-mailing?

In mail merge set a skipif field at the start of the merge document to skip records that don't match todays's date e.g.
{ SKIPIF { MERGEFIELD "DATEFIELDNAME" \@ "yyyyMMdd" } <> { DATE \@ "yyyyMMdd" }  }
where DATEFIELDNAME is the name of the date field in question
Graham Mayor (Microsoft Word MVP 2002-2019)
For more Word tips and downloads visit my web site
https://www.gmayor.com/Word_pages.htm

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks for your reply.

 

I am not able to point what you said.

 

Can you give me a picture guide?

Thanks,
Akhilesh Dalia

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

At the start of your document enter { SKIPIF { MERGEFIELD "DATEFIELDNAME" \@ "yyyyMMdd" } <> { DATE \@ "yyyyMMdd" }  }
Use CTRL+F9 for each pair of brackets { } and rep;ace the bold text with the field name of the date field you wish to validate. Then merge the document.
Graham Mayor (Microsoft Word MVP 2002-2019)
For more Word tips and downloads visit my web site
https://www.gmayor.com/Word_pages.htm

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Insert the mergefield that contains the date into your mail merge main document before any other mergefield.  Assuming that the field name is Date, it will look like

 

«Date»

 

Select that field and then hold down the CTRL key and press the F9 key which will result in the field being enclosed in a pair of field delimiters as shown below

 

{ «Date» }

 

Then Hold down the ALT key and press the F9 key to toggle on the display of the field codes, which will result in the following being displayed

 

{ { MERGEFIELD Date } }

 

Then place the selection between the two } } after the word Date and hold down the CTRL key and press F9 again so that you have

 

{ { MERGEFIELD Date } { } }

 

Now insert the balance of the text that Graham detailed in the appropriate places.  Make sure that you have a space either side of the <>

 

Finally Hold down the ALT Key and press F9 again to toggle off the display of the field codes.

 

Do not be alarmed by the fact that you no longer see the mergefield or any of the text that you entered.  The field construction is still there and when you execute the merge, it will cause the records that do not meet the criteria to be skipped.

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated September 30, 2021 Views 499 Applies to: