how to detect automatic line and page breaks?

J

John

I'm writing a screenplay and would like to write a macro
to automatically split dialog that spans an automatic page
break.

How do I detect automatic page breaks?

I also need to know how many lines of dialog already
appear above the page break (if it's only one line, the
whole thing should be pushed down; else it should be
split).

How do I detect automatic line breaks? I.e., how do I
count the number of lines in a range (as they appear on
the page)?

Thanks in advance,
John
 
J

Jay Freedman

Hi, John,

That's completely the wrong approach to solving the problem... Define a
style that has the paragraph format "Keep together", and apply that style to
all the text that has to stay on one page. If you have a series of
paragraphs that have to stay on one page, also assign the "Keep with next"
format (but the last paragraph of the group must have it turned off).

To answer the question directly, you can't detect automatic page breaks, or
at least not easily. You'd have to test the beginning and end of the
paragraph (using the .Information property of a Range object) to see whether
their page numbers are different. Since Word repaginates on the fly, you'd
have to run that check over and over. Forget it.
 
J

John

Jay,

Thanks for the reply. The problem is that if the block of
text is too big, instead of moving the whole thing to the
next page it should be split, with new text added:

ABRAHAM
Four score and seven
years ago, our
............................... page break
forefathers brought
forth on this continent


becomes:

ABRAHAM
Four score and seven
years ago, our
..............................
ABRAHAM (CONT'D)
forefathers brought
forth on this continent

....but I'll think about it some more. Thanks again for
the help.

John
 

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