View Single Post
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mail merge .. . If Then Else

1. Are all the {} the special field code braces that you can insert using
ctrl-F9?
2. Is the value definitely XX and not xx, xX etc?
3. Try adding double quotes around the { MERGEFIELD } field, i.e.

{ IF "{ MERGEFIELD PatientCode }" = "XX" "@" "" }

Peter Jamieson
wrote in message
oups.com...
On 8 Feb, 15:33, wrote:
Hi - i am having a few problems with the if then else conditional
statement with word mail merge. The logic that i am looking to
implement is if Value X = XX then print @ else print nothing. The
code is below. Now this seems very simple but for some reason doesnt
work and even when the condition is met it does not print @. As part
of the testing i have printed to screen Value X to confirm it contains
the data for the condition to be met but it doesnt write the @.

{ IF { MERGEFIELD PatientCode } = "XX" "@" "" }


So the issue i have is that although the condition seems to have been
met it does not execute the correct part of the conditional
statement. The data being used for the mail merge comes from a SQL
2000 SP3a database.