locked
Mail Merge Multiple Word Docs Linked To Primary Word Document RRS feed

  • Question

  • So I'm using Excel as my data source to my primary word document in a mail merge and I am trying to figure out how I can insert text from multiple secondary word documents for specific letters. Cant give too much info but I am sending thank you letters to people who donate money to a foundation and if its less than X amount I want text from letter A, if its more than amount X I want the text from Letter B. Only the primary doc is linked to the data source, and Letters A/B only have text on them, no MERGEFIELD's in them. I know this can be done I just cannot remember how it's done. 
    Monday, February 15, 2016 7:27 PM

Answers

  • There is no need to use separate documents. You can instead incorporate all the conditional text into an IF test coded along the lines of:

    {IF{MERGEFIELD Amount \# 0}< 100 "Content for donations of less than $100" "Content for donations of $100 or more"}

    where 100 is the amount that determines which version of the letter gets sent.

    Of course, you could keep the conditional content in separate documents, in which case you'd use an INCLUDETEXT field coded along the lines of:

    {INCLUDETEXT "C:\\Path\\{IF{MERGEFIELD Amount \# 0}< 100 "Small" "Large"}.docx"}

    where the 'C:\\Path\\' is the full path - with double backslashes for the path separators - and the document names are 'Small.docx' and 'Large.docx', respectively, and 100 is the amount that determines which version of the letter gets sent.

    Note: The field brace pairs (i.e. '{ }') for the above examples are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practical to add them via any of the standard Word dialogues. The spaces represented in the field constructions are all required.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Monday, February 15, 2016 11:06 PM