IF statement to show MERGEFIELD value, if exists, else show underline (Word 2013)

Mail merge source document includes field WRECID, which contains either a ten-digit string or nothing.

If data exists in the field, I want to show it; If the field is empty, I want an underline (specified by 20 underscore characters in the literal).

{ IF { MERGEFIELD WRECID } = "" "____________________" "{ MERGEFIELD WRECID }" } results in the literal "MERGEFIELD" instead of either the value in the field or an underline.

If I remove the spaces before "MERGEFIELD" & after "WRECID" in the condition:

{ IF {MERGEFIELD WRECID} = "" "____________________" "{MERGEFIELD WRECID}" } results in the literal "WRECID}" in all cases.

I've tried various other configurations but I never get what I'm looking for.

What am I doing wrong?

Thanks.

IGNORANCE UPDATE!!! - It turns out that the connection with the source data file was broken, so I reinstituted that & tried again. Sorry, but I'm quite the novice at this.

The result is that I do get the underline for records with no value in the WRECID field but I still get a literal, rather than data, for records with data in the field.

How can I accomplish my goal?

Answer
Answer
You must use CTRL+F9 to insert each pair of field delimiters { }
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 July 20, 2024 Views 3,152 Applies to: