Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index

On a whim, can you run the macro below. As a paranoid sort, I would say...

1. Save your document.
2. Run this macro.
3. If I missed something and it modifies the document, do not save the changes (it should not change the document).

Sub FindPageBreaks
  REM Author: Andrew Pitonyak
  Dim iCnt As Long
  Dim oCursor as Variant
  Dim oText As Variant
  Dim s As String
  Dim iRightCounter As Long   : iRightCounter = 0
  Dim wasRightPage As Boolean : wasRightPage = False

  oText = ThisComponent.Text
  oCursor = oText.CreateTextCursor()
    If NOT oCursor.gotoEndOfParagraph(True) Then Exit Do
    iCnt = iCnt + 1
    wasRightPage = False
    If NOT IsEmpty(oCursor.PageDescName) Then
      s = s & "Paragraph " & iCnt & " has a new page to style " & _
             oCursor.PageDescName & CHR$(10)
    End If
    If Not IsEmpty(oCursor.PageNumberOffset) Then
      s = s & "Paragraph " & iCnt & " has a new PageNumberOffset to " & _
             oCursor.PageNumberOffset & CHR$(10)
    End If
    If oCursor.BreakType <> Then
      s = s & "Paragraph " & iCnt & " has a page break" & CHR$(10)
      'oCursor.BreakType =
    End If
  Loop Until NOT oCursor.gotoNextParagraph(False)
  MsgBox s
End Sub

What will it tell you? It should tell you every time that the page style changes, and every time that the page number is specifically told to change "PageNumberOffset".

I am curious if you see that it is showing a page number offset change at a page change when the page numbering changes.

It would be easy to change this macro to "clear" page number changes. At least I expect that it should be as easy as setting an empty value for this. I should test that.

Yep, just checked, I made a change as follows, which clears all page number changes after paragraph 10.

    If Not IsEmpty(oCursor.PageNumberOffset) Then
      s = s & "Paragraph " & iCnt & " has a new PageNumberOffset to " & _
             oCursor.PageNumberOffset & CHR$(10)

      If iCnt > 10 Then
        Dim oEmpty
        oCursor.PageNumberOffset = oEmpty
      End If
    End If

On 11/13/2014 09:17 PM, anne-ology wrote:
        My guess would be you've found a bug ...
            or maybe ghosts  ;-)

From: svenja meyerricks <>
Date: Thu, Nov 13, 2014 at 9:09 AM
Subject: [libreoffice-users] LO Writer page numbering resets itself halfway
through document

Dear all,

I am not sure what to try anymore, so hoping that anyone on this list can
help please.

I have a long document (thesis) in .odf format, and the page numbers reset
themselves to 1 after page 170 or so (the page where the page break occured
sometimes changes, but even when I temporarily resolved it -see below- a
random page break or two always came back).

To resolve this, I have

- deleted and re-inserted page numbers several times (issue remained)
- searched for visible page breaks between pages (there are none)
- checked in the "format"/"paragraph"/"text flow" tab whether the first
paragraph on the reset page had the "Insert Break" box checked (it didn't)
- looked for the same in the paragraphs before and after the invisible page
break, but couldn't find anything.
- uninstalled and re-installed LibreOffice Version: (that fixed it
at first, but then the same thing happened)

I would be massively grateful if anyone could help please, as I'm not sure
what else to try.

Many thanks,


Andrew Pitonyak
My Macro Document:

To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
All messages sent to this list will be publicly archived and cannot be deleted


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.