Merged documents and IF statement

C

champy

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

Doug Robbins - Word MVP on news.microsoft.com

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
 
G

Graham Mayor

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top