INCLUDETEXT putting both docs into merge

M

MDales

What have I doing wrong here? I want the merge to insert one document if you
answer "loan" and a different document if you answer "LOC" . I get an error
message "A field calcualtion error occurred in Record 1" and it inserts BOTH
documents.

Here's what I've done codes:

{ASK LoanOrLOC "Is this a Loan or a Line of Credit? (loan or LOC)" \o}{IF
{"ASK LoanOrLOC" } = "loan" ""{INCLUDETEXT "N:\\Precedents\\Loan Approval
Merge.doc" } ""} {IF {"ASK LoanOrLOC"} = "LOC" "" {INCLUDETEXT
"N:\\Precedents\\Solicitor's Certificate Merge.doc"} ""}

I'm fairly new at this and it sure is more difficult than with WordPerfect,
which simply let you string macros together. Would sure like to know what
I'm doing wrong.
Martha
 
D

Doug Robbins - Word MVP

To start with, instead of the two If...then...Else constructions, you can
use

{IF {"ASK LoanOrLOC" } = "loan" {INCLUDETEXT "N:\\Precedents\\Loan Approval
Merge.doc" } {INCLUDETEXT "N:\\Precedents\\Solicitor's Certificate
Merge.doc"} }

But I suspect that the reason that you might be getting both documents is
that the response to the IF is neither "loan" nor "LOC" and with the double
quotes that you had before the "" {INCLUDETEXT part of each If...then...Else
field construction, you were getting the Not True result in both cases.

If using the modified If...then...Else always gives the same result,
regardless of whether "loan" or "LOC" is supplied, that would confirm my
suspicion and I would suggest that if you can, you add a field to the
datasource in which you specify which type of transaction it is and then
test for the value of that mergefield.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
M

MDales

Thanks. I changed it to add a field to the data source. It now inserts the
correct document, but I still get the same error message. Do I still have
anything extra in my codes? or maybe it's some other field causing the
problem. I will check the rest of the document, but in the meantime does
this look right?

{IF [MERGEFIELD LoanOrLineofCredit } = “Loan†{INCLUDETEXT
“N:\\Precedents\\Loan Approval.docâ€} {ELSE {INCLUDETEXT
“N:\\Precedents\\Certificate.doc:}} }

Martha
 
M

MDales

Please ignore my last question. I revised it to read:

{IF [MERGEFIELD LoanOrLineofCredit } = “Loan†{INCLUDETEXT
“N:\\Precedents\\Loan Approval.docâ€} {INCLUDETEXT
“N:\\Precedents\\Certificate.doc:} }

and found another error in a different field that was causing the error
message. It all works as needed now. So thanks so much for your help!

Martha
MDales said:
Thanks. I changed it to add a field to the data source. It now inserts the
correct document, but I still get the same error message. Do I still have
anything extra in my codes? or maybe it's some other field causing the
problem. I will check the rest of the document, but in the meantime does
this look right?

{IF [MERGEFIELD LoanOrLineofCredit } = “Loan†{INCLUDETEXT
“N:\\Precedents\\Loan Approval.docâ€} {ELSE {INCLUDETEXT
“N:\\Precedents\\Certificate.doc:}} }

Martha

Doug Robbins - Word MVP said:
To start with, instead of the two If...then...Else constructions, you can
use

{IF {"ASK LoanOrLOC" } = "loan" {INCLUDETEXT "N:\\Precedents\\Loan Approval
Merge.doc" } {INCLUDETEXT "N:\\Precedents\\Solicitor's Certificate
Merge.doc"} }

But I suspect that the reason that you might be getting both documents is
that the response to the IF is neither "loan" nor "LOC" and with the double
quotes that you had before the "" {INCLUDETEXT part of each If...then...Else
field construction, you were getting the Not True result in both cases.

If using the modified If...then...Else always gives the same result,
regardless of whether "loan" or "LOC" is supplied, that would confirm my
suspicion and I would suggest that if you can, you add a field to the
datasource in which you specify which type of transaction it is and then
test for the value of that mergefield.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top