If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
PRINT code
I have a document that has several IF tests. If the user
responds with a Y to a test, a document is included using INCLUDETEXT. We use PRINT codes to switch the printer into duplex mode in certain documents. These documents work fine on their own, and fine when included with INCLUDETEXT. However, if the INCLUDETEXT is conditional via an IF, the PRINT codes don't work! For example: Doc1.doc is a 5 page document that has a PRINT command at the start to switch the printer (HP4000) into Duplex: {PRINT 27"&l1s"} Doc2.doc has the following field in it: {IF {FILLIN Include_DOC_1}="Y" "{INCLUDETEXT "DOC1.DOC"}"} Any ideas? Any help appreciated. Cheers, Garry |
#2
|
|||
|
|||
PRINT code
I haven't seen this problem before and don't know of a fix, but...
If it's the combination of INCLUDETEXT nested in an IF that's causing the problem, what I would try is to ensure the INCLUDETEXT is outside the IF. You will always have to include /a/ file. e.g. have an empty document called empty.doc and try either { INCLUDETEXT "{ IF "{ FILLIN Include_DOC_1 }" = "Y" "DOC1.DOC" "empty.doc" }" } or { IF "{FILLIN Include_DOC_1}" = "Y" "{ SET mydoc1 "DOC1.DOC" }" "{ SET mydoc1 "empty.doc" }" }{ INCLUDETEXT "{ REF mydoc1 }" } -- Peter Jamieson "Garry Rathbone" wrote in message ... I have a document that has several IF tests. If the user responds with a Y to a test, a document is included using INCLUDETEXT. We use PRINT codes to switch the printer into duplex mode in certain documents. These documents work fine on their own, and fine when included with INCLUDETEXT. However, if the INCLUDETEXT is conditional via an IF, the PRINT codes don't work! For example: Doc1.doc is a 5 page document that has a PRINT command at the start to switch the printer (HP4000) into Duplex: {PRINT 27"&l1s"} Doc2.doc has the following field in it: {IF {FILLIN Include_DOC_1}="Y" "{INCLUDETEXT "DOC1.DOC"}"} Any ideas? Any help appreciated. Cheers, Garry |
#3
|
|||
|
|||
PRINT code
Peter,
Thanks for your suggestion, it works great. INCLUDETEXT seems to add an extra return even when there's nothing in the empty document, but we can live with that. Thanks again, Garry -----Original Message----- I haven't seen this problem before and don't know of a fix, but... If it's the combination of INCLUDETEXT nested in an IF that's causing the problem, what I would try is to ensure the INCLUDETEXT is outside the IF. You will always have to include /a/ file. e.g. have an empty document called empty.doc and try either { INCLUDETEXT "{ IF "{ FILLIN Include_DOC_1 }" = "Y" "DOC1.DOC" "empty.doc" }" } or { IF "{FILLIN Include_DOC_1}" = "Y" "{ SET mydoc1 "DOC1.DOC" }" "{ SET mydoc1 "empty.doc" }" }{ INCLUDETEXT "{ REF mydoc1 }" } -- Peter Jamieson "Garry Rathbone" wrote in message ... I have a document that has several IF tests. If the user responds with a Y to a test, a document is included using INCLUDETEXT. We use PRINT codes to switch the printer into duplex mode in certain documents. These documents work fine on their own, and fine when included with INCLUDETEXT. However, if the INCLUDETEXT is conditional via an IF, the PRINT codes don't work! For example: Doc1.doc is a 5 page document that has a PRINT command at the start to switch the printer (HP4000) into Duplex: {PRINT 27"&l1s"} Doc2.doc has the following field in it: {IF {FILLIN Include_DOC_1} ="Y" "{INCLUDETEXT "DOC1.DOC"}"} Any ideas? Any help appreciated. Cheers, Garry . |
#4
|
|||
|
|||
PRINT code
Hi Garry,
I think you'll find that the problem with your original field was that there was no space between the '=' and the "Y". That is, instead of: {IF {FILLIN Include_DOC_1}="Y" "{INCLUDETEXT "DOC1.DOC"}"} you needed: {IF {FILLIN Include_DOC_1}= "Y" "{INCLUDETEXT "DOC1.DOC"}"} or: {IF {FILLIN Include_DOC_1}= "Y" {INCLUDETEXT "DOC1.DOC"}} Cheers "Garry Rathbone" wrote in message ... I have a document that has several IF tests. If the user responds with a Y to a test, a document is included using INCLUDETEXT. We use PRINT codes to switch the printer into duplex mode in certain documents. These documents work fine on their own, and fine when included with INCLUDETEXT. However, if the INCLUDETEXT is conditional via an IF, the PRINT codes don't work! For example: Doc1.doc is a 5 page document that has a PRINT command at the start to switch the printer (HP4000) into Duplex: {PRINT 27"&l1s"} Doc2.doc has the following field in it: {IF {FILLIN Include_DOC_1}="Y" "{INCLUDETEXT "DOC1.DOC"}"} Any ideas? Any help appreciated. Cheers, Garry --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.684 / Virus Database: 446 - Release Date: 13/05/2004 |
Thread Tools | |
Display Modes | |
|
|