I use button "Record Macros" but when I use this macros the following is happen.
Macros open dialog window "page style: firs page" and if I want to go on I must enter margin values by hand.
After that macros do the next steps of the recording otherwise nothing is happen.
I trying to create macros (in LibreOffice) that when I'm open a document (single page document for example)
macros automatically formatting page size and margins, font family and size.
RoryOF wrote:If the intention is to change the formatting of an existing work or a small number of works, ....................
...... I have downloaded a copy of War and Peace (550,000 words), ...... the entire book into normal book format in less than 15 minutes..
RoryOF wrote:Look at this thread:
https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=82036
I think there is a macro in that thread to set page margins, but honestly you would be better to use customised templates.
sub changeallpagesizesusedindocument
rem Portrait Sizes:
newpagesizeWidth = 14800 'this is my value
newpagesizeHeight = 21000 'this is my value
newTopMargin = 800 'this is my value
newBottomMargin = 800 'this is my value
newLeftMargin = 800 'this is my value
newRightMargin = 800 'this is my value
oViewCursor = ThisComponent.CurrentController.getViewCursor()
oViewCursor.jumptofirstpage(false)
do
s = oViewCursor.PageStyleName
oStyle = ThisComponent.StyleFamilies.getByName("PageStyles").getByName(s)
if oStyle.IsLandscape=True then 'this is for Landscape, the margins as if we rotated portrait 90°right, change as you like
oStyle.Width = newpagesizeHeight
oStyle.Height = newpagesizeWidth
oStyle.TopMargin = newLeftMargin
oStyle.BottomMargin = newRightMargin
oStyle.LeftMargin = newBottomMargin
oStyle.RightMargin = newTopMargin
else 'this is for portrait
oStyle.Width = newpagesizeWidth
oStyle.Height = newpagesizeHeight
oStyle.TopMargin = newTopMargin
oStyle.BottomMargin = newBottomMargin
oStyle.LeftMargin = newLeftMargin
oStyle.RightMargin = newRightMargin
end if
loop while oViewCursor.jumptonextpage(false)
oViewCursor.jumptofirstpage(false)
End Sub
Lautrec wrote:RoryOF wrote:If the intention is to change the formatting of an existing work or a small number of works, ....................
...... I have downloaded a copy of War and Peace (550,000 words), ...... the entire book into normal book format in less than 15 minutes..
Well it's not same like my small project but this is exactly that I want + new page dimensions and margins.
The second is a joke, right? I mean it's hard to believe, but well done.
The second is a joke, right? I mean it's hard to believe, but well done.
In fact, Zixi64, most "typewriter" like spacings can be removed by careful use of Find and Replace.
Users browsing this forum: No registered users and 9 guests