Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How to you say IF [field] contains "x" then "" else ""
In a Word merge, how to you have Word look at a text file and proceed with
THEN/ELSE only if the field "CONTAINS" or "IF BEGINS WITH" a key word in the expression. Since the field is not a number the greater/less and even "blank" do not apply. Thanks. |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
How to you say IF [field] contains "x" then "" else ""
Hi rwav1,
For a field starting with a given string: {IF{MERGEFIELD MyField} = "MyTestString*" "True Text" "False Text"} For a field ending with a given string: {IF{MERGEFIELD MyField} = "*MyTestString" "True Text" "False Text"} For a field starting with 3 characters before a given string: {IF{MERGEFIELD MyField} = "???MyTestString*" "True Text" "False Text"} For a field ending with 3 characters after a given string: {IF{MERGEFIELD MyField} = "*MyTestString???" "True Text" "False Text"} There is no general 'contains' test - the test string must exist at the start or end of the larger string or a specified number of characters from either end of the larger string. -- Cheers macropod [Microsoft MVP - Word] "rwav1" wrote in message ... In a Word merge, how to you have Word look at a text file and proceed with THEN/ELSE only if the field "CONTAINS" or "IF BEGINS WITH" a key word in the expression. Since the field is not a number the greater/less and even "blank" do not apply. Thanks. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I can't "Open" a downloaded template. Only "Save" and "Cancel" | Microsoft Word Help | |||
What does "char" "char1" "char2" mean in styles in Word? | Microsoft Word Help | |||
how do I set up a "expand/collapse" or "show/hide" field in Word | Microsoft Word Help | |||
"Print current page" should have a "+n pages" field. | Microsoft Word Help | |||
The "Symbol" under "Insert" disappeared and replaced by "Number" | Microsoft Word Help |