Remove all manual page breaks

If anyone knows a way could you let me know please

Edit your question to better explain the purpose. Don’t forget to mention OS name and LO version.

There are two types of page breaks in a writer document:

  • “automatic”: they are created when text overflows a page; they do not exist as explicit format mark
  • manual: created by user, recorded in the document

Edit>Find & Replace is limited to paragraph content. A page break is a “flag” between paragraph. Thus F&R can’t act on it. Look for an eventual extension handling them.

If you simply want to view the document as a single “page”, try View | Web

Hi Rob thanks, I wanted to remove the manual breaks, but may be another way around with your idea

Thnaks Ajlittoz

I hear you,

There might be a way via Macros I guess

AltSearch.oxt could do it. Activate regular expressions.

The offline help reads:

\m - represents a manual page break.
Limitation: Slow when used separately. If subexpression () is used, the parameter \m must be at the start of the search string, and it must not be alone: \m(…) but not (…)\m.

Hi Grantler, thank you sir

I looked for exactly this info, and couldn’t find it, your post has just helped.

It seems to be sporadically spread around the internet/ or just hidden from me :slight_smile:

If anyone else needs to find it,

look here:
http://macrojtb.hys.cz/HelpAltSearch_en.html

Other helpful info here:
https://help.libreoffice.org/latest/en-US/text/shared/01/02100001.html?DbPAR=SHARED#bm_id3146765

And here:

“Remove all manual breaks without removing paragraphs”

Run the code in Tools > Macros

Tools > Macros > Organise macros > Basic > Standard > My Macros > (create) Module1 > Edit

(then copy/ paste code, and save). Exit/ close window.

Then

Tools > Macros > Run > Organise macros > Standard > Module1 > Run

The code:
Remove all manual breaks without removing paragraphs;
(uploaded by Lupp. Here:
[Solved] How to remove all empty pages with a macro (View topic) • Apache OpenOffice Community Forum).

Sub removeHardPageBreaks
doc = ThisComponent
doc.UndoManager.EnterUndoContext("Remove hard PageBreaks")
paragraphs = doc.Text
for each para in paragraphs
para.BreakType = 0
next para
doc.UndoManager.LeaveUndoContext
End Sub

(you might need to copy code from the original link, there are no gaps between lines in the original, it wont stay like that here for some reason…) ← it is a matter of formatting the answer - fixed

(reformatted by ajlittoz)