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
Peter Jamieson - 14 May 2004 12:15 GMT
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 }" }

Signature
Peter Jamieson
> I have a document that has several IF tests. If the user
> responds with a Y to a test, a document is included using
[quoted text clipped - 21 lines]
>
> Garry
Garry Rathbone - 14 May 2004 14:32 GMT
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...
[quoted text clipped - 41 lines]
>
>.
macropod - 14 May 2004 23:14 GMT
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
> I have a document that has several IF tests. If the user
> responds with a Y to a test, a document is included using
[quoted text clipped - 21 lines]
>
> Garry