Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / April 2008

Tip: Looking for answers? Try searching our database.

Snytax for CompareTo Field IF THEN ELSE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
seno - 01 Apr 2008 14:31 GMT
Hi my first post woohoo,

I use mail merge in the work I do but wish to know what is syntax I us
for IF ELSE THEN statment. Hope fully it reads clearly.

Excel sheet
Field    Trust_name
1        Plantation
2        The Cabbage

In the form letter, [ ] is where i want the sentence to chang
depending on the condition of the Trust_name. Example listed below.

"...as trustee for [ ] <<Trust_name>> Trust,..."

The statement I inserted [ ] in Word is:
IF   FieldName:Trust_name    Comparison:EqualTo   CompareTo:"The..."
THEN "blank"
ELSE "the"

Result I want is:
1        Plantation         "...as trustee for the Plantatio
Trust,..."
2        The Cabbage     "...as trustee for The Cabbage Trust,..."

What I want to know is what is the correct syntax to use for CompareT
box:
"The-SPACE-Any number of character there after" for the compar
CompareTo box?

I guessed and tried "The*" doesn't work.

It cant be "The-Any number of character there after" as there word
begin with The such as Thespian and Theodore for example.

I hope theres an answer.
I pray in the mean time.

Cheers!
Sen

--
seno
Graham Mayor - 01 Apr 2008 16:14 GMT
If I understand you correctly, what you require is

"...as trustee for { IF { MERGEFIELD Trust_name } <> "The *" "The "}{
MERGEFIELD Trust_name }Trust,..."

You can type this from the keyboard using CTRL+F9 for the field bracket
pairs
The wildcard does work if used as shown. Note the spaces.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Hi my first post woohoo,
>
[quoted text clipped - 36 lines]
> Cheers!
> Seno

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.