|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
MergeField multiple conditions (format date and delete previous text if blank)
Hello everyone,
I'm facing an issue with mergefield editing. I have to insert two conditions: -Date format as: \@"dd-MM-yyyy" - Delete previous text as: \b"Date: " So, i tried to run this like: MERGEFIELD Date \b"Date: " \@"dd-MM-yyyy" But it displays only the date with the desired format. Could anyone help me with this please? |
#2
|
|||
|
|||
I moved this to the mailmerge forum.
The \b switch does not insert text. It inserts a space. { IF { MERGEFIELD Date } <> "" "Date: { MERGEFIELD Date \@"dd-MM-yyyy" }" } |
#3
|
||||
|
||||
Not so - it can insert whatever content one desires. The real problem is that it doesn't work with other switches.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
I want to modify some templates which produce documents in live production.
Data comes from the core operational system - so to change the format in this data its not an option. My data contains dates in format yyyy-dd-mm. I have to merge dates in the format dd-mm-yyyy with the prefix "Date: " and to hide the mergefield in case that the date is not available. |
#5
|
|||
|
|||
What I provided does what you want.
Attached is a document containing the field. I assume that your mergefield is named "Date." |
#6
|
|||
|
|||
Quote:
You have right. I didn't insert the "{}" with ctrl+F9. It works really great!! Thank you very much! Best Regards |
#7
|
|||
|
|||
You are welcome.
Few have not been caught by that. Experience builds skill, sometimes painful experience! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Delete comma and space after blank merged value. Also remove Previous space and word before blank | Alex1s85 | Mail Merge | 4 | 01-18-2020 11:30 PM |
Highlight Blank Cell Based on Multiple Conditions from Other Cells in Row | PrincessApril | Excel | 3 | 11-21-2019 12:50 PM |
from text to table, with conditions depending on format | Marco | Word VBA | 2 | 10-29-2015 06:40 PM |
multiple conditions, and blank cells with the countifs function | jaden0605 | Excel | 1 | 03-30-2014 01:50 AM |