View Single Post
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Merged documents and IF statement

Doug,
I think you may have overlooked the fact that in French the quote characters
are « », which makes the OP's presentation more confusing to read for
English readers. Hopefully the characters survive the newsgroup format or
this will appear as gibberish
{ IF { MERGEFIELD Titre } = « M » « 14h » « 15 » }
is probably correct and that the problem is that of curly brackets being
typed?

--

Graham Mayor - Word MVP

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




Doug Robbins - Word MVP on news.microsoft.com wrote:
I assume that M , 14h and 15 are not mergefields?

Also, you cannot insert the field delimiters by using the { } keys on
the keyboard. You must use Ctrl+F9 to insert them.

If you use Alt+F9 to toggle on the display of field codes, and
assuming that M is a mergefield, your field construction should
look like
{ IF { MERGEFIELD Titre } = "M" "14h" "15" }

If you insert the Titre mergefield using the insert mergefield
facility and then toggle on the display of the field codes, it will
then appear as
{ MERGEFIELD Titre } or maybe { MERGEFIELD "Titre" } - it does not
matter which

If you select that and then Press Ctrl+F9, you will get

{ { MERGEFIELD Titre } }

and you can then add the balance of the required text in the
appropriate places.


"champy" wrote in message
...
I use the herebelow script for merged documents.
Each individual field is well updated, but the if statement does not
work. Any idea?
Thanks
«Titre»
«Prénom»«Nom»
«Adresse_Ligne_1»
«Ville»





«Titre»,


Le cours aura lieu le lundi à {IF {Titre} = « M » « 14h » « 15 »}