0

I am writing a form letter in MS Word in which I am trying to have the document auto-populate all pronouns according to the gender of the subject.

I have entered this code:

{IF{MERGEFIELD Gender}=F "She" "He"} 

and also this code:

{IF{MERGEFIELD Gender}=F "her" "him"}

The code works in the source document for feminine pronouns, but when I try to merge the form letter with an actual recipient, both fields produce this:

=F

I am not sure how to fix this problem. I have tried splitting the code into separate commands for gender=f and gender=m, I have tried adding or removing spaces, I have tried moving =F inside the {} brackets.

Please help!

2
  • Have you used Ctrl+F9 to create the field and "Insert Merge Field" to insert the field-name?
    – harrymc
    Dec 6, 2019 at 18:32
  • Since you are comparing a string literal (F), have you tried encapsulating it with quotes? ="F"
    – Yorik
    Dec 6, 2019 at 21:00

2 Answers 2

1

The simplest solution is to simply add a set of pronoun sets in the database.

If the pronoun sets are not filled on completing the form, they should default based on the filling of the gender option by a simple autofill function.

You can then pull these boxes just like any other data attached to the address card from the database.

The use of these fields not only eliminates unneeded runtime macros to select pronouns, but also permits the freefilling of forms for non-standard situations.

This solution is thus, all around better because of KISS (Keep It Simple "Silly") principal.

0

Try putting spaces before and after =:

{IF{MERGEFIELD Gender} = F "She" "He"}

It’s also better to put the F into quotes, and add a space after IF:

{IF {MERGEFIELD Gender} = "F" "She" "He"}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .