Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
if...then...else
I would like to insert a series of if then else word fields into a mail merge
letter but if they are not satisified i want the whole thing suppressed rather than have a space devoted to it. I guess it is something that you have to do with switches but not sure how. Any help appreciated. Yve |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
if...then...else
Do it like this:
{ IF { MERGEFIELD MiddleName } = "" "{ MERGEFIELD LastName }" "{ MERGEFIELD MiddleName } { MERGEFIELD LastName }" } -- 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 "Yve Ke" wrote in message ... I would like to insert a series of if then else word fields into a mail merge letter but if they are not satisified i want the whole thing suppressed rather than have a space devoted to it. I guess it is something that you have to do with switches but not sure how. Any help appreciated. Yve |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
if...then...else
Thanks for the advice about getting rid of the then...else but it still isn't
working. I want to do the following produce a list (sort of) { IF { MERGEFIELD Blah } = "Jack" "Jack" } { IF { MERGEFIELD BlahBlah} = "Jack" "Jack" } { IF { MERGEFIELD BlahBlahBlah} = "Jack" "Jack" " } But if it isn't satsiafied it will give me a blank line which I don't want Hope you can help Yve "Doug Robbins - Word MVP" wrote: Do it like this: { IF { MERGEFIELD MiddleName } = "" "{ MERGEFIELD LastName }" "{ MERGEFIELD MiddleName } { MERGEFIELD LastName }" } -- 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 "Yve Ke" wrote in message ... I would like to insert a series of if then else word fields into a mail merge letter but if they are not satisified i want the whole thing suppressed rather than have a space devoted to it. I guess it is something that you have to do with switches but not sure how. Any help appreciated. Yve |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
if...then...else
That's because you have your Blahs and Jacks in the wrong places. They need
to go on the same line and the line feed needs to be included between the quotes. { IF { MERGEFIELD Blah } = "Jack" "Jack " }{ IF { MERGEFIELD BlahBlah} = "Jack" "Jack " }{ IF { MERGEFIELD BlahBlahBlah} = "Jack" "Jack " } -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Yve Ke wrote: Thanks for the advice about getting rid of the then...else but it still isn't working. I want to do the following produce a list (sort of) { IF { MERGEFIELD Blah } = "Jack" "Jack" } { IF { MERGEFIELD BlahBlah} = "Jack" "Jack" } { IF { MERGEFIELD BlahBlahBlah} = "Jack" "Jack" " } But if it isn't satsiafied it will give me a blank line which I don't want Hope you can help Yve "Doug Robbins - Word MVP" wrote: Do it like this: { IF { MERGEFIELD MiddleName } = "" "{ MERGEFIELD LastName }" "{ MERGEFIELD MiddleName } { MERGEFIELD LastName }" } -- 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 "Yve Ke" wrote in message ... I would like to insert a series of if then else word fields into a mail merge letter but if they are not satisified i want the whole thing suppressed rather than have a space devoted to it. I guess it is something that you have to do with switches but not sure how. Any help appreciated. Yve |
#5
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
if...then...else
Thanks this is much better and suppresses empty fields BUT now I am getting
the spaces at the end - the list is quite long with, say, 10 lines but if there are only a couple that is all the space I want devoted to it Yve "Graham Mayor" wrote: That's because you have your Blahs and Jacks in the wrong places. They need to go on the same line and the line feed needs to be included between the quotes. { IF { MERGEFIELD Blah } = "Jack" "Jack " }{ IF { MERGEFIELD BlahBlah} = "Jack" "Jack " }{ IF { MERGEFIELD BlahBlahBlah} = "Jack" "Jack " } -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Yve Ke wrote: Thanks for the advice about getting rid of the then...else but it still isn't working. I want to do the following produce a list (sort of) { IF { MERGEFIELD Blah } = "Jack" "Jack" } { IF { MERGEFIELD BlahBlah} = "Jack" "Jack" } { IF { MERGEFIELD BlahBlahBlah} = "Jack" "Jack" " } But if it isn't satsiafied it will give me a blank line which I don't want Hope you can help Yve "Doug Robbins - Word MVP" wrote: Do it like this: { IF { MERGEFIELD MiddleName } = "" "{ MERGEFIELD LastName }" "{ MERGEFIELD MiddleName } { MERGEFIELD LastName }" } -- 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 "Yve Ke" wrote in message ... I would like to insert a series of if then else word fields into a mail merge letter but if they are not satisified i want the whole thing suppressed rather than have a space devoted to it. I guess it is something that you have to do with switches but not sure how. Any help appreciated. Yve |
#6
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
if...then...else
The construction does not add any lines unless there is content in the
fields. These fields all go on the same line, immediately after and on the same line as the field they follow. The next field goes immediately after the construction. Essentially you have {Mergefield afield { IF { MERGEFIELD Blah } = "Jack" "Jack " }Continue here If there is nothing in the field Blah you get {Mergefield afield} Continue here -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Yve Ke wrote: Thanks this is much better and suppresses empty fields BUT now I am getting the spaces at the end - the list is quite long with, say, 10 lines but if there are only a couple that is all the space I want devoted to it Yve "Graham Mayor" wrote: That's because you have your Blahs and Jacks in the wrong places. They need to go on the same line and the line feed needs to be included between the quotes. { IF { MERGEFIELD Blah } = "Jack" "Jack " }{ IF { MERGEFIELD BlahBlah} = "Jack" "Jack " }{ IF { MERGEFIELD BlahBlahBlah} = "Jack" "Jack " } -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Yve Ke wrote: Thanks for the advice about getting rid of the then...else but it still isn't working. I want to do the following produce a list (sort of) { IF { MERGEFIELD Blah } = "Jack" "Jack" } { IF { MERGEFIELD BlahBlah} = "Jack" "Jack" } { IF { MERGEFIELD BlahBlahBlah} = "Jack" "Jack" " } But if it isn't satsiafied it will give me a blank line which I don't want Hope you can help Yve "Doug Robbins - Word MVP" wrote: Do it like this: { IF { MERGEFIELD MiddleName } = "" "{ MERGEFIELD LastName }" "{ MERGEFIELD MiddleName } { MERGEFIELD LastName }" } -- 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 "Yve Ke" wrote in message ... I would like to insert a series of if then else word fields into a mail merge letter but if they are not satisified i want the whole thing suppressed rather than have a space devoted to it. I guess it is something that you have to do with switches but not sure how. Any help appreciated. Yve |