Page Breaks When Using Macro in Word

B

Bud Veltman

I have a macro that uses pulls data from an external file. I use several
with/end with statements to extract the data that I need. The output is many
pages of data that is one line of data followed by a line of dashes as shown
below.

0|01001111|01|L1_SD_01_00_1111|SD -GND FL -ELEVATOR LOBBY

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -

The first line of the above is then repeated, but with different data and
followed by another line of dashes. The output may be 70 - 150 pages,
depending on the complexity of the data file.

My problem is that many of the pages will break after the data line, but
before the line of dashes. This is very important as errors on the data line
are hand written on the dashes so that the imported file can be corrected at
its source.

How do I ensure that the page only breaks after a line of dashes or maybe
group the output of data and dashes so as to not allow a break between the
two lines?

Any assistance would be greatly appreciated.

Bud Veltman
(e-mail address removed)
 
J

Jean-Guy Marcil

Bud Veltman said:
I have a macro that uses pulls data from an external file. I use several
with/end with statements to extract the data that I need. The output is many
pages of data that is one line of data followed by a line of dashes as shown
below.

0|01001111|01|L1_SD_01_00_1111|SD -GND FL -ELEVATOR LOBBY

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -

The first line of the above is then repeated, but with different data and
followed by another line of dashes. The output may be 70 - 150 pages,
depending on the complexity of the data file.

My problem is that many of the pages will break after the data line, but
before the line of dashes. This is very important as errors on the data line
are hand written on the dashes so that the imported file can be corrected at
its source.

How do I ensure that the page only breaks after a line of dashes or maybe
group the output of data and dashes so as to not allow a break between the
two lines?

Quickly, three suggestions:

Do not use typed dashes.
1)
Place the data in individual table rows.
Set a "Space after" for the data paragraph style in order to provide space
for handwriting.
Set the bottom border of each row to a "dash" style of border.
2)
Instead of a table, apply a bottom border to the paragraph style applied to
the data.
Again, use a "Dash" style of border and set the border lower down using a
value high enough to allow space for handwriting, 15 points perhaps?

Use actual typed dashes
3)
Apply a style to the data paragraph that is using the parameter "Keep with
Next" so that the data will always stay together with the following line of
typed dashes.
Make sure not to use this style for the paragraph of typed dashes which
should not have "Keep with Next" turned on.
 

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