I need a macro that places a conditional merge field with a nested IF statements. Currently, we copy the merge fields from one document and paste them into an endless amount of different Word documents. In other words, I want to replace the source document with a command button that inputs the conditional merge field.
I’m currently using the expression:
[login to view URL] Range:=[login to view URL], _
MERGEFIELD:="""Client_MiddleName""", Comparison:=wdMergeIfIsNotBlank, _
TrueText:="MERGEFIELD "Client_MiddleName"", _
FalseText:=""
I hit a barrier placing “Client_MiddleName” merge field if true (TrueText). The output should be:
{ IF {MERGEFIELD “Client_MiddleName” }<>”” “{MERGEFIELD “Client_MiddleName” }” “” }
Hello,
You haven't said what the barrier is but I guess your code results in text containing MERGEFIELD, rather than the value of Client_MiddleName (if it's not empty).
Changing the code to fix this is easy.
Cheers,
Fred