I have an excel document that I am using in a mail merge into Word. What I need to do is to include multiple copies of the same picture based on the value in the mail merge field. For example, if the field TOTAL is 1, then display 1 STOP.png, if it is 2, then display 2 STOP.png, if it is 3, then display 3 STOP.png, etc. I tried a huge nested if statement but it didn't seem to like the way I was putting it together for the multiple copies. Here is what I was attempting:
{ IF {Mergefield Sugar} = 0 ""
{ if {Mergefield Sugar} = 1 {IncludePicture "/Dropbox/ThePackyCompany/Games/CandyGames/CandyMan/Scapes/Scapes/SUGAR_SMALL.png"}
{ if {Mergefield Sugar} = 2 {IncludePicture "/Dropbox/ThePackyCompany/Games/CandyGames/CandyMan/Scapes/Scapes/SUGAR_SMALL.png"}{IncludePicture "/Dropbox/ThePackyCompany/Games/CandyGames/CandyMan/Scapes/Scapes/SUGAR_SMALL.png"}
{ if {Mergefield Sugar} = 3 {IncludePicture "/Dropbox/ThePackyCompany/Games/CandyGames/CandyMan/Scapes/Scapes/SUGAR_SMALL.png"}{IncludePicture "/Dropbox/ThePackyCompany/Games/CandyGames/CandyMan/Scapes/Scapes/SUGAR_SMALL.png"}{IncludePicture "/Dropbox/ThePackyCompany/Games/CandyGames/CandyMan/Scapes/Scapes/SUGAR_SMALL.png"}
{ if {Mergefield Sugar} = 4 {IncludePicture "/Dropbox/ThePackyCompany/Games/CandyGames/CandyMan/Scapes/Scapes/SUGAR_SMALL.png"}{IncludePicture "/Dropbox/ThePackyCompany/Games/CandyGames/CandyMan/Scapes/Scapes/SUGAR_SMALL.png"}{IncludePicture "/Dropbox/ThePackyCompany/Games/CandyGames/CandyMan/Scapes/Scapes/SUGAR_SMALL.png"}{IncludePicture "/Dropbox/ThePackyCompany/Games/CandyGames/CandyMan/Scapes/Scapes/SUGAR_SMALL.png"}
{ if {Mergefield Sugar} = 5 {IncludePicture "/Dropbox/ThePackyCompany/Games/CandyGames/CandyMan/Scapes/Scapes/SUGAR_SMALL.png"}{IncludePicture "/Dropbox/ThePackyCompany/Games/CandyGames/CandyMan/Scapes/Scapes/SUGAR_SMALL.png"}{IncludePicture "/Dropbox/ThePackyCompany/Games/CandyGames/CandyMan/Scapes/Scapes/SUGAR_SMALL.png"}{IncludePicture "/Dropbox/ThePackyCompany/Games/CandyGames/CandyMan/Scapes/Scapes/SUGAR_SMALL.png"}{IncludePicture "/Dropbox/ThePackyCompany/Games/CandyGames/CandyMan/Scapes/Scapes/SUGAR_SMALL.png"} ""}
}
}
}
}
}
There is obviously a lot of directory stuff, but my attempt to essentially concat several images into one does not work. I was looking for a way to do a inner loop and go from 1 to the merge field value and check in an if for zero but can't find any syntax for a loop in the mail merge that was not the main merge loop.
Suggestions?
Aucun commentaire:
Enregistrer un commentaire