I like having half-inch (1.27 cm) margins on everything I write, but Writer provides no designated facility to make this the default. I don’t like to change the default page style, because that had some unwanted side effects when I tried it. I tried recording a macro and setting the margins to what I want, but when I ran it all it did was open the Page Style dialog.
I like having half-inch (1.27 cm) margins on everything I write, but…I don’t like to change the default page style, because that had some unwanted side effects when I tried it.
I believe that page styles (and in particular the default page style) are the recommended mechanism for specifying default sizes for margins. If you have multiple configurations you’d like to save, then document templates are a good solution.
What were the “unwanted side effects” that you experienced when you tweaked your default page style? Perhaps there’s an underlying issue in LO that we should address!
I’ve rephrased the question. It would be simpler to have a macro that executed whenever I started Writer.
I just got an email asking me to accept the best answer for this question. This is not the best answer. Furthermore, now I can’t even figure out how to set the default template. And I never want to receive email from this site.
It is also my opinion that the “best practice” here is to set the default page style accordingly in a template and use this template for all new documents. You could also try to put often-used paragraph and character styles in the template for even more convenience. Changing a document’s styles through programming every time the application starts sounds inefficient. It is possible to access a document’s style properties through LO Basic, but this functionality is best left to other uses.
I’ve rephrased the question. It would be simpler to have a macro that executed whenever I started Writer [to set default margins]
To make the macro execute when Writer opens, take a look at the LibreOffice Online Help regarding Event-Driven Macros. The event you want to use is right at the top of the table:
EVENT | An ASSIGNED MACRO IS EXECUTED... ---------------+--------------------------------- Program Start | ... after a LibreOffice application is started.
Regarding setting the margins in a macro, take a look at Villeroy’s answer to Calc Macro to set printer parameters?
I’m not a master of macro coding, in case you hadn’t realized. I have only the most vague idea what the code on the page means, no idea where to enter it, and even less idea of how to make it apply to the document instead of the printer. Furthermore, this is a different office suite and product, so there might be trivial incompatibilities that throw me off for all I know.
@uglyface200 – All good points. Sorry that we don’t have more time to spend on Answers here, but we’re all volunteers and we’re trying to juggle our time between a lot of different Questions.
I also think the answer of @qubit1 is good solution.
････,then document templates are a good solution.
As reference, I think the following code is helpful;
[ Properties ] => Top : .TopMargin / Bottom : .BottomMargin / Left : .LeftMargin / Right : RightMargin
Where do I enter that code? How do I make a template the default?