Conditionally IncludeText

T

Tom Bean

I am trying to create a mail merge document that conditionally includes
several other documents. I have been able to do this by using merge fields
like: { IF { Condition }<> "" "{ INCLUDETEXT "C:\\Path\\Include1.doc" }"}.

Unfortunately, all the included documents have different page set up so I
really need a Section Break before the INCLUDETEXT field like the following:
{ IF { Condition }<> "" "=====Section Break (next page)=====
{ INCLUDETEXT "C:\\Path\\Include1.doc" }"}.

When I string multiple of these IF fields together to include other
documents, the Section Break is converted to a Page Break. This causes the
page set up for the included document to be lost.

If I insert a paragraph mark (enter) between the Section Break and the
INCLUDETEXT field, the Section Break is not converted to a Page Break but I
get a blank line for every document that is not included.

Is there another way to accomplish conditionally including multiple
documents to retain their page set up without inserting blank lines?

Thanks,
Tom
 
M

macropod

Hi Tom,

Have you tried adding a lock switch (ie '\!') to your INCLUDETEXT field (eg {IF{Condition}<> "" "{INCLUDETEXT
"C:\\Path\\Include1.doc" \!}"})? I'm not sure if that will work, but its worth a try.

Cheers
 
T

Tom Bean

macropod,

As I understand the lock switch, I don't believe it will work for me because
the documents contain fields that need to be updated when they are included
in the main document.

After further investigation, even though the break text changes from
"Section Break" to "Paragraph Break", the paragraph breaks seem to retain
the different page setup. Also, not all on the section breaks change to
paragraph breaks. I'm not certain if the representation in the document
matches what Word really does with the breaks.

Is it possible that a paragraph break is really a section break even though
it says it is a "Paragraph Break"?

Tom

macropod said:
Hi Tom,

Have you tried adding a lock switch (ie '\!') to your INCLUDETEXT field
(eg {IF{Condition}<> "" "{INCLUDETEXT "C:\\Path\\Include1.doc" \!}"})?
I'm not sure if that will work, but its worth a try.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Tom Bean said:
I am trying to create a mail merge document that conditionally includes
several other documents. I have been able to do this by using merge
fields like: { IF { Condition }<> "" "{ INCLUDETEXT
"C:\\Path\\Include1.doc" }"}.

Unfortunately, all the included documents have different page set up so I
really need a Section Break before the INCLUDETEXT field like the
following:
{ IF { Condition }<> "" "=====Section Break (next page)=====
{ INCLUDETEXT "C:\\Path\\Include1.doc" }"}.

When I string multiple of these IF fields together to include other
documents, the Section Break is converted to a Page Break. This causes
the page set up for the included document to be lost.

If I insert a paragraph mark (enter) between the Section Break and the
INCLUDETEXT field, the Section Break is not converted to a Page Break but
I get a blank line for every document that is not included.

Is there another way to accomplish conditionally including multiple
documents to retain their page set up without inserting blank lines?

Thanks,
Tom
 
M

macropod

Hi Tom,

With Section breaks that follow the end of a paragraph, it sometimes happens that the Section break becomes invisible. This is
usually only the case if the paragraph break is at or near the end of a line. Is that what you're seeing?

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Tom Bean said:
macropod,

As I understand the lock switch, I don't believe it will work for me because the documents contain fields that need to be updated
when they are included in the main document.

After further investigation, even though the break text changes from "Section Break" to "Paragraph Break", the paragraph breaks
seem to retain the different page setup. Also, not all on the section breaks change to paragraph breaks. I'm not certain if the
representation in the document matches what Word really does with the breaks.

Is it possible that a paragraph break is really a section break even though it says it is a "Paragraph Break"?

Tom

macropod said:
Hi Tom,

Have you tried adding a lock switch (ie '\!') to your INCLUDETEXT field (eg {IF{Condition}<> "" "{INCLUDETEXT
"C:\\Path\\Include1.doc" \!}"})? I'm not sure if that will work, but its worth a try.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Tom Bean said:
I am trying to create a mail merge document that conditionally includes several other documents. I have been able to do this by
using merge fields like: { IF { Condition }<> "" "{ INCLUDETEXT "C:\\Path\\Include1.doc" }"}.

Unfortunately, all the included documents have different page set up so I really need a Section Break before the INCLUDETEXT
field like the following:
{ IF { Condition }<> "" "=====Section Break (next page)=====
{ INCLUDETEXT "C:\\Path\\Include1.doc" }"}.

When I string multiple of these IF fields together to include other documents, the Section Break is converted to a Page Break.
This causes the page set up for the included document to be lost.

If I insert a paragraph mark (enter) between the Section Break and the INCLUDETEXT field, the Section Break is not converted to
a Page Break but I get a blank line for every document that is not included.

Is there another way to accomplish conditionally including multiple documents to retain their page set up without inserting
blank lines?

Thanks,
Tom
 
T

Tom Bean

macropod,

No, the section break is not becoming invisible. It is being replaced with
"Paragraph Break" but it still seems to behave as a section break. That is,
the page set up margins are maintained as they were when the break was a
Section Break".

Thanks,
Tom

macropod said:
Hi Tom,

With Section breaks that follow the end of a paragraph, it sometimes
happens that the Section break becomes invisible. This is usually only the
case if the paragraph break is at or near the end of a line. Is that what
you're seeing?

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Tom Bean said:
macropod,

As I understand the lock switch, I don't believe it will work for me
because the documents contain fields that need to be updated when they
are included in the main document.

After further investigation, even though the break text changes from
"Section Break" to "Paragraph Break", the paragraph breaks seem to retain
the different page setup. Also, not all on the section breaks change to
paragraph breaks. I'm not certain if the representation in the document
matches what Word really does with the breaks.

Is it possible that a paragraph break is really a section break even
though it says it is a "Paragraph Break"?

Tom

macropod said:
Hi Tom,

Have you tried adding a lock switch (ie '\!') to your INCLUDETEXT field
(eg {IF{Condition}<> "" "{INCLUDETEXT "C:\\Path\\Include1.doc" \!}"})?
I'm not sure if that will work, but its worth a try.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

I am trying to create a mail merge document that conditionally includes
several other documents. I have been able to do this by using merge
fields like: { IF { Condition }<> "" "{ INCLUDETEXT
"C:\\Path\\Include1.doc" }"}.

Unfortunately, all the included documents have different page set up so
I really need a Section Break before the INCLUDETEXT field like the
following:
{ IF { Condition }<> "" "=====Section Break (next page)=====
{ INCLUDETEXT "C:\\Path\\Include1.doc" }"}.

When I string multiple of these IF fields together to include other
documents, the Section Break is converted to a Page Break. This causes
the page set up for the included document to be lost.

If I insert a paragraph mark (enter) between the Section Break and the
INCLUDETEXT field, the Section Break is not converted to a Page Break
but I get a blank line for every document that is not included.

Is there another way to accomplish conditionally including multiple
documents to retain their page set up without inserting blank lines?

Thanks,
Tom
 

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