View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP on news.microsoft.com Doug Robbins - Word MVP on news.microsoft.com is offline
external usenet poster
 
Posts: 407
Default Merged documents and IF statement

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.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"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 »}