locked
Problem with Word 2007 Mail Merge RRS feed

  • Question

  • Please help me! I've been searching for hours for the answer and maybe it's on here already but I can't seem to find it. I'm having a problem with a specific field code. When I merge to a new document, the field code gets the unknown opcode error message. The kicker is that I'm using the same field code with another field that works fine, the only difference is the merge fields I'm using. Here are my codes- I essentially want to put in a comma and space only if both fields are present.

    Here is the one that does not work:

    { IF { MERGEFIELD Spouse_Email } { IF { MERGEFIELD Spouse_Cell } <> "" ", " "" } "" ", " "" }

    And here is the one that does work:

    { IF { MERGEFIELD Email } { IF { MERGEFIELD Cell_ } <> "" ", " "" } "" ", " "" }

    One detail:

    In the new merged document- this error only occurs on the last records, from about 200 to 600, But, the error code shows up in all of them in the original mail merge document. Please tell me I'm overlooking something dumb. This is ever so frustrating.

    Thank you so much for you help!



    Friday, November 29, 2013 4:45 AM

Answers

  • Try:

    {IF{MERGEFIELD Spouse_Email}<> "" {IF{MERGEFIELD Spouse_Cell}<> "" ", "}}

    and:

    {IF{MERGEFIELD Email}<> "" {IF{MERGEFIELD Cell}<> "" ", "}}

    Note that you can't rely on what happens in your mailmerge main document to reflect the ultimate output, as your field codes may remain unresolved, or be incorrectly resolved, until the merge is actually exectuted - even the preview isn't reliable.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by George123345 Wednesday, December 4, 2013 1:28 AM
    Friday, November 29, 2013 5:46 AM