In LibreOffice Writer, there is no built-in "one-click" method to delete all headers and footers across all page styles at once. However, you can speed up the process using one of these approaches:
1. Use a Macro (Automation)
You can write a simple LibreOffice Basic macro to remove headers and footers from all page styles in your document. Here’s how:
Steps to Run a Macro:
- Open the Macro Editor:
- Press Alt + F11 (or go to Tools > Macros > Organize Macros > LibreOffice Basic).
- Create a New Macro:
- In the Macro Editor, create a new module and paste the following code:
Sub DeleteAllHeadersFooters
Dim oDoc As Object
Dim oStyles As Object
Dim oStyle As Object
oDoc = ThisComponent
oStyles = oDoc.StyleFamilies.getByName("PageStyles")
For Each oStyle In oStyles
oStyle.HeaderIsOn = False
oStyle.FooterIsOn = False
Next oStyle
End Sub
- Run the Macro:
- Close the editor and run the macro (Tools > Macros > Run Macro).
- This will disable headers and footers for all page styles in the document.
2. Modify the Default Page Style
If your document primarily uses the Default page style, you can:
- Go to Format > Page.
- In the Header and Footer tabs, uncheck Header on and Footer on.
- Click OK to apply to all pages using the Default style.
3. Use Find & Replace (Limited)
- Press Ctrl + F to open Find & Replace.
- Click More Options and enable Search for Styles.
- Search for Header or Footer content and replace it with nothing.
- This only clears content but does not disable headers/footers.
Which Method Should You Use?
- For a one-time fix: Use the macro.
- For a single page style: Manually disable headers/footers in Format > Page.
- For complex documents: The macro is the fastest way.