Referring to mailmerge fields in an if statement

Posted by Zian Choy on Super User See other posts from Super User or by Zian Choy
Published on 2011-01-14T23:52:08Z Indexed on 2011/01/14 23:55 UTC
Read the original article Hit count: 349

Filed under:
|

Context:

  • Windows 7
  • Microsoft Office Word 2007

I have a mailmerge field named "On_FB".

Current code:

{ IF { On_FB } = "Y" "You're on Facebook." "You're not on Facebok."}

The moment I get out of code-editing view, the code goes haywire. When I flip back to code-editing view, I see that the code has magically turned into:

{ IF " Y" = "Y" "You're on Facebook." "You're not on Facebok."}

Needless to say, this is a complete bust because it will always say that the person is not on Facebook.

I tried putting { On_FB } on its own and that works fine.

What can I do to make the If statement work?

(By the way, all the { and } were inserted via CTRL+F9.)

© Super User or respective owner

Related posts about microsoft-word

Related posts about mail-merge