Hi, I'm having some trouble figuring out how to replace a basic Merge field with a conditional statement. I'm looking to, using macros, replace something like:
with:
Code:
{ IF {MERGEFIELD "A"} = "Yes", {MERGEFIELD "T"}{MERGEFIELD "F"}}
This is what I've got going already:
Code:
Sub Ex()
Dim oFld As Field
For Each oFld In ActiveDocument.Fields
With oFld
If .Type = wdFieldMergeField Then
If Trim(Replace(Replace(.Code, "MERGEFIELD", ""), Chr(34), "")) = "A" Then
// Replace Merge Field with Conditional - Help
.Update
End If
End If
End With
Next
End Sub