I am having trouble inserting a MERGEFIELD in a conditional MERGEFIELD.
E.G.
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!
inserting a MERGEFIELD in a conditional MERGEFIELD
-
- 5StarLounger
- Posts: 962
- Joined: 09 Feb 2010, 00:33
- Location: Patterson Lakes, Victoria, Australia
inserting a MERGEFIELD in a conditional MERGEFIELD
You do not have the required permissions to view the files attached to this post.
Avagr8day, regards, Peter
-
- 5StarLounger
- Posts: 962
- Joined: 09 Feb 2010, 00:33
- Location: Patterson Lakes, Victoria, Australia
Re: inserting a MERGEFIELD in a conditional MERGEFIELD
Ha ha, problem solved. I had to save the doc, close it and reopen, now it works just fine.
Avagr8day, regards, Peter
-
- Administrator
- Posts: 78238
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: inserting a MERGEFIELD in a conditional MERGEFIELD
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 508
- Joined: 17 Dec 2010, 03:14
Re: inserting a MERGEFIELD in a conditional MERGEFIELD
The field code in your post was incorrectly formatted. It should have been expressed as:Peter Kinross wrote: ↑12 Feb 2021, 03:43I 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.
{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]
[Fmr MS MVP - Word]
-
- 4StarLounger
- Posts: 596
- Joined: 10 Jan 2016, 15:56
- Location: Madison, Wisconsin
Re: inserting a MERGEFIELD in a conditional MERGEFIELD
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.
Attorney Charles Kenyon
Templates in Microsoft Word
Modifying the QAT
The Importance of Styles in Microsoft Word
Templates in Microsoft Word
Modifying the QAT
The Importance of Styles in Microsoft Word
-
- 4StarLounger
- Posts: 508
- Joined: 17 Dec 2010, 03:14
Re: inserting a MERGEFIELD in a conditional MERGEFIELD
True, but the lack of spaces either side of the "1" also meant the IF test could never perform its evaluation properly.Charles Kenyon wrote: ↑26 Mar 2021, 16:06Peter, 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 Edstein
[Fmr MS MVP - Word]
[Fmr MS MVP - Word]
-
- 5StarLounger
- Posts: 962
- Joined: 09 Feb 2010, 00:33
- Location: Patterson Lakes, Victoria, Australia
Re: inserting a MERGEFIELD in a conditional MERGEFIELD
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.
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.
Avagr8day, regards, Peter