inserting a MERGEFIELD in a conditional MERGEFIELD

User avatar
Peter Kinross
5StarLounger
Posts: 877
Joined: 09 Feb 2010, 00:33
Location: Patterson Lakes, Victoria, Australia

inserting a MERGEFIELD in a conditional MERGEFIELD

Post by Peter Kinross »

I am having trouble inserting a MERGEFIELD in a conditional MERGEFIELD.
E.G.
MergeCodes.jpg
Should read
Our main service for the year was in fund selection for your super in XYZ Co.
But the Co doesn't show.
I have tried with and without quotes around the field names, neither work.
HELP!
You do not have the required permissions to view the files attached to this post.
Avagr8day, regards, Peter

User avatar
Peter Kinross
5StarLounger
Posts: 877
Joined: 09 Feb 2010, 00:33
Location: Patterson Lakes, Victoria, Australia

Re: inserting a MERGEFIELD in a conditional MERGEFIELD

Post by Peter Kinross »

Ha ha, problem solved. I had to save the doc, close it and reopen, now it works just fine.
Avagr8day, regards, Peter

User avatar
HansV
Administrator
Posts: 72002
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: inserting a MERGEFIELD in a conditional MERGEFIELD

Post by HansV »

:thumbup:
Regards,
Hans

User avatar
macropod
4StarLounger
Posts: 458
Joined: 17 Dec 2010, 03:14

Re: inserting a MERGEFIELD in a conditional MERGEFIELD

Post by macropod »

Peter Kinross wrote:
12 Feb 2021, 03:43
I am having trouble inserting a MERGEFIELD in a conditional MERGEFIELD.
E.G.
MergeCodes.jpg
Should read
Our main service for the year was in fund selection for your super in XYZ Co.
But the Co doesn't show.
I have tried with and without quotes around the field names, neither work.
The field code in your post was incorrectly formatted. It should have been expressed as:
{IF{MERGEFIELD Wrap}= 1 "Our main service for the year was in fund selection for your super in {MERGEFIELD Co}"}
Note especially the spaces each side of the '1' and the absence of quotes each side of the space before {MERGEFIELD Co}.
Last edited by macropod on 27 Mar 2021, 02:12, edited 1 time in total.
Paul Edstein
[Fmr MS MVP - Word]

User avatar
Charles Kenyon
4StarLounger
Posts: 402
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: inserting a MERGEFIELD in a conditional MERGEFIELD

Post by Charles Kenyon »

Peter, your code is showing the second mergefield as the falsetext in the IF field. It should only display if your condition is false. There is NO WAY that saving and reopening the document would fix this. Paul has given you the construction that should be used.

User avatar
macropod
4StarLounger
Posts: 458
Joined: 17 Dec 2010, 03:14

Re: inserting a MERGEFIELD in a conditional MERGEFIELD

Post by macropod »

Charles Kenyon wrote:
26 Mar 2021, 16:06
Peter, your code is showing the second mergefield as the falsetext in the IF field. It should only display if your condition is false. There is NO WAY that saving and reopening the document would fix this.
True, but the lack of spaces either side of the "1" also meant the IF test could never perform its evaluation properly.
Paul Edstein
[Fmr MS MVP - Word]

User avatar
Peter Kinross
5StarLounger
Posts: 877
Joined: 09 Feb 2010, 00:33
Location: Patterson Lakes, Victoria, Australia

Re: inserting a MERGEFIELD in a conditional MERGEFIELD

Post by Peter Kinross »

Thanks Charles, sorry about the delay (see one of my other posts that you were responding to for the reason).
I rearranged the doc so I could do without the 'IF' clause. But next time I'll know what to do. Unless I will have forgotten by then. :sad:
Avagr8day, regards, Peter