Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
rwav1 rwav1 is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I can't "Open" a downloaded template. Only "Save" and "Cancel" Dave Microsoft Word Help 1 April 4th 08 02:28 PM
What does "char" "char1" "char2" mean in styles in Word? Li Microsoft Word Help 2 September 5th 07 03:22 PM
how do I set up a "expand/collapse" or "show/hide" field in Word WordDoc_FeatureUser Microsoft Word Help 2 May 12th 07 06:29 PM
"Print current page" should have a "+n pages" field. rawahoho Microsoft Word Help 5 November 16th 06 03:26 PM
The "Symbol" under "Insert" disappeared and replaced by "Number" Eling Microsoft Word Help 3 September 13th 06 03:29 PM


All times are GMT +1. The time now is 09:38 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"