Discussion Locked

IF Function in Merging in Word

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

My current problem is merging addresses. The addresses are not fields in the data base from where the records are retreived, instead there is a code for each address which has a corresponding word file with just the address in it. I am writing if functions such as {IF Management _co = "alliohana" "{INCLUDETEXT C:\\condos\\aliiohana.doc}"""} {IF Management_co = "metropol"
"{INCLUDETEXT C:\\condos\\Metropol.doc}"""}

I have about 20 address codes and I do not want to repeat the IF loop 20 times. How doI write an If loop where it would look at the code and then
look for the matching address file without having to do go through 20 loops. OR what if I integrated all the addresses into one file and wanted the code to match an address in the file. How do I do this? I hope I have given you sufficient information to understand my problem.
If you have any suggestions on how I could do this differently, it would be great.

3 replies

by dklippert

Nested If statements are only good up to 20 levels.I'm not sure why it's necessary to have the addresses in seperate docs. Is there a reason that the addresses cannot be included with the other merge data?
While Word Fields do not include a Case statement or Lookup, you might be able to work this out in the underlying Data source.
Perhaps developing a Query in Access or using a lookup table in Excel to set up the source data.

This discussion is closed to new replies.