[Solved] [Macro] Setting OpenOffice to default to single page

Discuss the word processor
Post Reply
frag2k4
Posts: 2
Joined: Wed Oct 18, 2023 8:50 pm

[Solved] [Macro] Setting OpenOffice to default to single page

Post by frag2k4 »

New here, so hello.

I Have a problem as the subject mentions and have tried searching this but have not found exactly what I am looking for.

Generally I have the same issue as others where when opening a file it loads up as a double page, now I know of the view, status bar and 3 page type options. What I need to know is, can I set this somehow to default as a single scroll down? I have gone through the options and formats but nothing has really jumped out that could solve this. I have thousands of documents and at some point a year or so ago everything was fine, now not so much, even after setting them to single page once saved and closed when reopening them they are back to double page again, its getting rather annoying.

Any help is appreciated, thanks.
Last edited by frag2k4 on Thu Oct 19, 2023 6:22 pm, edited 1 time in total.
OpenOffice 4.1.7 on Windows 10
User avatar
RoryOF
Moderator
Posts: 35210
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Setting Open Office to default to single page

Post by RoryOF »

A document remembers the last page display used. So unless someone else has a better idea, I think you will have to adjust each file.

Is clicking on the single page icon in the Status Bar too much of an effort? One mouse move and one click each time!
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
User avatar
Hagar Delest
Moderator
Posts: 33633
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Setting Open Office to default to single page

Post by Hagar Delest »

frag2k4 wrote: Wed Oct 18, 2023 8:58 pm at some point a year or so ago everything was fine, now not so much, even after setting them to single page once saved and closed when reopening them they are back to double page again
That is pretty weird indeed. Have you upgraded AOO in the mean time?
A macro that runs automatically to apply the correct setting when you open a Writer document may help.

Else, you may consider switching to LibreOffice: [Tutorial] Considering a Switch from OpenOffice to LibreOffice? Some Useful Information.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 25.2 portable on Windows 11.
JeJe
Volunteer
Posts: 3132
Joined: Wed Mar 09, 2016 2:40 pm

Re: Setting Open Office to default to single page

Post by JeJe »

It doesn't pin down why its happening for you but you can create a macro with the macro recorder to set the view mode when you open a document. I get this using the macro recorder and then clicking on the single page icon next to the zoom slider

Code: Select all

sub SetViewLayout
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ViewLayout.Columns"
args1(0).Value = 1
args1(1).Name = "ViewLayout.BookMode"
args1(1).Value = false

dispatcher.executeDispatch(document, ".uno:ViewLayout", "", 0, args1())


end sub



You don't need to understand it, copy and paste that or your macro recording to a module in your Standard library - see installing a code snippet here:

viewtopic.php?t=5519

Once you've done that go to
Tools menu/Customise/Events tab

Select OpenOffice from the Save as combo
Then Select the Open Document event from the listbox and click the Macro button and find where you put the macro to assign it.

When you open a document it will then run that macro to set a single page view.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
frag2k4
Posts: 2
Joined: Wed Oct 18, 2023 8:50 pm

Re: Setting Open Office to default to single page

Post by frag2k4 »

JeJe wrote: Wed Oct 18, 2023 11:56 pm It doesn't pin down why its happening for you but you can create a macro with the macro recorder to set the view mode when you open a document. I get this using the macro recorder and then clicking on the single page icon next to the zoom slider


You don't need to understand it, copy and paste that or your macro recording to a module in your Standard library - see installing a code snippet here:

viewtopic.php?t=5519

Once you've done that go to
Tools menu/Customise/Events tab

Select OpenOffice from the Save as combo
Then Select the Open Document event from the listbox and click the Macro button and find where you put the macro to assign it.

When you open a document it will then run that macro to set a single page view.
Thanks will give it a go, shame there doesn't seem to be a default but I can deal with that.
Hagar Delest wrote: Wed Oct 18, 2023 11:18 pm
That is pretty weird indeed. Have you upgraded AOO in the mean time?
A macro that runs automatically to apply the correct setting when you open a Writer document may help.

Else, you may consider switching to LibreOffice: [Tutorial] Considering a Switch from OpenOffice to LibreOffice? Some Useful Information.
I am not aware of any upgrade on my end, just checked my downloads and the only version I got was downloaded back in Feb of 2020. Will be trying the Macro option for now, but will download the LibreOffice as a potential backup, thanks.
OpenOffice 4.1.7 on Windows 10
Post Reply