Microsoft Office Professional Plus WORD 2010 - Multiple Emails using Mail Merge Conditional IF THEN ELSE with Hyperlinks to multiple pdf files does not work. RRS feed

  • Question

  • When I use this logic and assign CLICK HERE to each of the following hyperlinks..

    {IF {MERGEFIELD CampCode} = "Camp01" "{HYPERLINK http://xxx.xxx.org/camp2011/Camp01.pdf}} {IF {MERGEFIELD CampCode} = "Camp02" "{HYPERLINK http://xxx.xxx.org/camp2011/Camp02.pdf}} {IF {MERGEFIELD CampCode} = "Camp03" "{HYPERLINK http://xxx.xxx.org/camp2011/Camp03.pdf}}

    the person receiving the email gets the CLICK HERE link for all of the camps.  CLICK HERE CLICK HERE CLICK HERE.  Could you give me syntax to accomplish this so the person receiving the email gets the CLICK HERE only once and it is to the correct pdf file for the CampCode.

    I was able to use the in Word 2007, however, it does not work in 2010.

    Because I couldn't get it to work, I tried a different approach by writing the link to a field in the table that is used for the datasource mail merge fields and called it Attachment01.  For camper 3, the data in Attachment01 is http://xxx.xxx.org/camp2011/Camp01.pdf,    For this test, I put the following logic in the Word Document. 

    {HYPERLINK {MERGEFIELD Attachment01}} 

    This worked, however, when I ran it again using the same word document and new data such as  For camper one, the data in Attachment01 is http://xxx.xxx.org/camp2011/Camp05.pdf,  For camper two, the data in Attachment01 is http://xxx.xxx.org/camp2011/Camp05.pdf, it put what was in the hyperlink from the first time it ran which was Camp01.pdf instead of Camp05.pdf.

     Can you help me with a solution on how I can email my campers and send them a different link, depending on what camp they are attending. 

    Wednesday, April 13, 2011 9:18 PM


  • Hi FCA,

    Try coding the field as:
    {HYPERLINK "{IF{MERGEFIELD CampCode}= "Camp01" "http://xxx.xxx.org/camp2011/Camp01.pdf" {IF{MERGEFIELD CampCode}= "Camp02" "http://xxx.xxx.org/camp2011/Camp02.pdf" {IF{MERGEFIELD CampCode}= "Camp03" "http://xxx.xxx.org/camp2011/Camp03.pdf" " "}}}"}

    Note: If you want the Hyperlink to display 'CLICK HERE' or something such as a hyperlink, insert that text in your document first and insert use that to insert a hyperlink to itself. Then replace the field code for the hyperlink with the nested IF statements above.

    Update: Given your mergefield's contents, you could probably even use:
    {HYPERLINK "{QUOTE "http://xxx.xxx.org/camp2011/{MERGEFIELD CampCode}.pdf"}"}

    Paul Edstein
    [MS MVP - Word]
    • Marked as answer by Max Meng Monday, April 18, 2011 8:50 AM
    Thursday, April 14, 2011 12:51 AM