Matching literal text "???" in Word 2010 field code IF statement


Joined
Apr 4, 2017
Messages
2
Reaction score
0
I'm using Word 2010 and merging in text from another piece of software, an automated document processor I have limited control over. The processor replaces null values with ??? before merging them into a Word template. I would like to use Word field code conditionality to test whether given text equals literal ???. Using the characters as-is also matches if there's a three digit/letter value in the field, and I haven't been able to successfully escape the question marks so that they mean just the character ?. I've tried using backslashes, QUOTE, SET and SYMBOL functions, and am out of ideas.

The conditional I'm using looks like this, where REFNO is the text provided by the document processor:
{ IF {REFNO} = "???" "blank" "Not blank"}

How can I match this correctly?
 
Ad

Advertisements

macropod

Microsoft MVP
Joined
Mar 2, 2012
Messages
553
Reaction score
48
You could use a compound field coded as:
{IF{={IF{REFNO}> "'>>>'" 1 0}*{IF{REFNO}< "@@@" 1 0}}= 0 "not "}blank

Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practical to add them via any of the standard Word dialogues. Note also the inner pair of ' characters in "'>>>'".
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top