Hello,
I have a mail merge function that works great except for this one case.
The document checks a merge field (Y/N values) and uses INCLUDETEXT based on the result.
The odd occasion, a file doesn't exist which causes a field calcuation error and "Error! Not a valid filename." appears in the area for INCLUDETEXT.
I would like to verify the Y/N value and if there is a Y, then I want to check if the file exists. If the file doesn't exist, nothing should happen. If it does, the file is included.
Here is a sample of the existing code:
Based on the following site, I tried to compare the error message.
While trying to keep things simple, I'm just trying to get the error comparison working first (before adding the Y/N check):
If I toggle the field codes for the IF INCLUDETEXT section, the result is:
This is not working as I had hoped.
Any suggestions on how I can accomplish this?
Thanks.
If at first you don't succeed, then sky diving wasn't meant for you!
I have a mail merge function that works great except for this one case.
The document checks a merge field (Y/N values) and uses INCLUDETEXT based on the result.
The odd occasion, a file doesn't exist which causes a field calcuation error and "Error! Not a valid filename." appears in the area for INCLUDETEXT.
I would like to verify the Y/N value and if there is a Y, then I want to check if the file exists. If the file doesn't exist, nothing should happen. If it does, the file is included.
Here is a sample of the existing code:
Code:
{IF {MERGEFIELD MULTIPLE}="N" "" "
...
{INCLUDETEXT "O:\\...\\...\\name{MERGEFIELD NUM}.dbf" \* CHARFORMAT}"}
Based on the following site, I tried to compare the error message.
While trying to keep things simple, I'm just trying to get the error comparison working first (before adding the Y/N check):
Code:
{IF {INCLUDETEXT "O:\\...\\...\\name{MERGEFIELD NUM}.dbf"}="Error! Not a valid filename" "" "
...
{INCLUDETEXT "O:\\...\\...\\name{MERGEFIELD NUM}.dbf" \* CHARFORMAT}"}
If I toggle the field codes for the IF INCLUDETEXT section, the result is:
{IF Error! Not a valid filename. = "Error! Not a valid filename." "" "
...
This is not working as I had hoped.
Any suggestions on how I can accomplish this?
Thanks.
If at first you don't succeed, then sky diving wasn't meant for you!