Hi Leslie,
If you can't add this information in your data source
(which you unfortunately don't mention). And no, Word
doesn't support "Like". Closest you can get is a COMPARE
field; you'll want to read up on it in the Help, and do
note that it is case-senstive. Here's an exmaple
{ IF { Compare "{ Mergefield type_name }" = "Nurs*" } = 0
"Administration" "clinical" }
> I need to have some text in my document that depends on
> whether the merge field 'type_name' starts with the
[quoted text clipped - 10 lines]
> {IF {MERGEFIELD type_name} like "nurs"
> & "*" "Clinical" "Administrative"}
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Sep 30 2003)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)
Cindy
Many thanks for your reply. The example you gave in fact
worked a treat without my even having to read up
the 'Help' - although I have spent some time there so that
I understand the syntax.
Thanks again
Les.
NB. my data source is an access mdb.
>-----Original Message-----
>Hi Leslie,
[quoted text clipped - 34 lines]
>
>.
Cindy M -WordMVP- - 23 Apr 2004 16:11 GMT
> Many thanks for your reply. The example you gave in fact
> worked a treat without my even having to read up
> the 'Help' - although I have spent some time there so that
> I understand the syntax.
> NB. my data source is an access mdb.
Glad it worked for you :-)
Note that, given Access, I'd have probably chosen to do this
in an "expression" in an Access query. Since Access supports
wildcards and other functions Word does not have, it's often
more efficient. Plus, if you're going to need it often, you
only have to do it the one time and can re-use the query for
other merges.
The expression could look something like this:
TypeOfJob: IIF(Left([type_name],
4)="nurs","clinical","admin")
TypeOfJob would then show up in your datasource as a merge
field.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :-)