WORD: don't break the last sentence on a page
Thread poster: DZiW

DZiW
Ukraine
English to Russian
+ ...
Dec 21, 2017

Hi guys,

After eliminating the white spaces and other stuff, I'm struggling to cope with the issue to prevent MS Word from breaking the last line on every page--the beginning of the sentence is on one page and its ending is on the other. Yes, long paragraphs are prone to such a thing, but I really doubt I'm the only or the first to encounter an annoyance.

It's really annoying and I don't know how to simplify the task:
1) if there's such a property, move all the 'broken' or flying sentences to the next page
-OR-
2) find the last symbol at the page and if it's not end-of-line [as .?!")]>] then move the line.

Any ideas would be more than welcome.
TY


 

Kevin Fulton  Identity Verified
United States
Local time: 20:20
German to English
Widows and orphans Dec 22, 2017

When only the last line of the para­graph ap­pears at the top of the next page, that line is called a widow. When only the first line of the para­graph ap­pears at the bot­tom of the first page, that line is called an or­phan.

There's a fix for this in Word: Right-click in the text and se­lect Paragraph → Line and Page Breaks → check Widow / Orphan control.
This should help keep things under control.


 

DZiW
Ukraine
English to Russian
+ ...
TOPIC STARTER
thank you, Kevin, yet still Dec 22, 2017

I did try to amend the issue at ease, however it either keeps breaking edge lines (not necessary the last in the paragraph) into two parts at page break, splitting the end unto the next or moves such whole paragraphs...

Also I tried to clear formatting and styles at no avail.

Perhaps, a simple vba or a life-hack would do nicely?


 

Daniel Frisano
Switzerland
Local time: 02:20
Member (2008)
English to Italian
+ ...
Uhm Dec 23, 2017

Let me try to wrap my head around this.

So you want all your pages to end with an end-of-sentence character such as .?!")]> ... right?

If such a character comes in the middle of a long paragraph, then Word should automatically split the paragraph (but only for such characters that are the last of their kind in that page), so the 1st half of the paragraph stays in that page and ends with .?!")]> and the 2nd half starts at the new page.

Now, what happens if afterwards you add or delete text, change font size, change margins, or make any other change that affects the page layout? Should Word re-join the split paragraphs and split them again according to the new page breaks?

This could be solved if there was a special character functioning as a "conditional page break" to be inserted instead of the normal space after each .?!")]> . The last "conditional page break" character in each page breaks the page. Perhaps with some clever programming...

Stated another way, you need a "keep lines together" option that works sentence-by-sentence instead of paragraph-by-paragraph. This implies that you should be able (or required) to define what a sentence is, i.e., which characters should be read as sentence-ending characters, .?!")]> and such. Complicated, but not impossible. Yet, what happens when, as an exception to the rule, you want a sentence-ending character to behave differently? (E.g., when citing an author, say, T. S. Eliot, you don't want those periods after T and S to be read as sentence-ending).

[Edited at 2017-12-23 14:25 GMT]


 

Hans Lenting  Identity Verified
Netherlands
Member (2006)
German to Dutch
When all solutions fail Dec 25, 2017

Depending on the complexity of the document’s layout, you could use a real book editor like Papyrus: https://www.papyrus.de/wiki/seitenlayout-und-stammseiten/#Verwaiste_Zeilen_verhindern_Schusterjungen_und_Hurenkinder

The Page object in Word VBA isn’t very useful:

https://msdn.microsoft.com/en-us/vba/word-vba/articles/page-object-word

There are many problems when using the Page object or alternative approaches: https://shaunakelly.com/word/word-development/selecting-or-referring-to-a-page-in-the-word-object-model.html


[Edited at 2017-12-25 19:05 GMT]


 

Tom in London
United Kingdom
Local time: 01:20
Member (2008)
Italian to English
do this Dec 25, 2017

Go to format ---->paragraph--->and click on the little box that says "Don't add space between paragraphs of the same style"

 

DZiW
Ukraine
English to Russian
+ ...
TOPIC STARTER
meanwhile Dec 25, 2017

Hi Tom, not for this case, unfortunately--no diff.

Hans, I have never heard about that program, so I'd like to give it a try.
As for .break, the problem is paragraphs are broken between pages while breaking its sentences, so I don't know how to hand it properly. Perhaps, .sentence(_broken).insertbefore VbCrLF would do, yet how to spot them... Any similar properties?


 

Hans Lenting  Identity Verified
Netherlands
Member (2006)
German to Dutch
Text boxes? Dec 27, 2017

How about abusing text boxes to keep paragraphs together?

i7skdp1yylskaflleg2f.pngcyt8z0txzjyaa280tdlc.pngam5o456uppmrt8mjlqio.png


 

DZiW
Ukraine
English to Russian
+ ...
TOPIC STARTER
q'n'd soulution Jan 1

1. Check first char at the page;
2. If LOWCASE letter, then move this line;
3. Continue to the end.

Sub Xline()
i = 2 'START FROM PAGE TWO

Do '----------------MAIN LOOP

Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=i 'TOP OF THE i-th PAGE
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend 'SELECT
c = Left(Trim(Selection.Text), 1) 'WHAT'S THE FIRST CHAR?
If c Like "[a-zа-я]" Then 'IF LOWCASE ALPHA
With Selection
.Collapse
.Extend: .Extend: .Extend 'SELECT THE WHOLE LINE

'Exit Sub 'IF JUST HIGHLIGHTING, THEN STOP
.InsertBefore vbCrLf 'MOVE LINE
.Collapse

ThisDocument.Repaginate 'UPDATE NUMBER OF PAGES
DoEvents

i = i - 1 'RE-CHECK THE PAGE AND REPEAT MOVING OUT
End With 'SELECT

End If 'BROKEN ALPHA

i = i + 1 'PROGRESS
Loop Until i > ThisDocument.Range.Information(wdNumberOfPagesInDocument)
'----------------MAIN LOOP
Selection.Collapse 'UNSELECT

End Sub

Of course, it's neither optimized, nor universal, but it works for me.
Although sometimes it's better to resize, reformat or move the whole paragraph...

A simpler way?

[Edited at 2018-01-02 16:48 GMT]


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

WORD: don't break the last sentence on a page

Advanced search






CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use SDL Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

More info »
SDL MultiTerm 2019
Guarantee a unified, consistent and high-quality translation with terminology software by the industry leaders.

SDL MultiTerm 2019 allows translators to create one central location to store and manage multilingual terminology, and with SDL MultiTerm Extract 2019 you can automatically create term lists from your existing documentation to save time.

More info »



Forums
  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search