You also can do it with an
IF Field and an AutoText field or building block content control as the truetext or falsetext. It depends on the building block.
See
Microsoft Word Field Maths Tutorial. This does not require a macro but it is not necessarily easy.