Page 1 of 1

OO Writer Macros Usage

PostPosted: Wed Oct 30, 2019 6:18 pm
by Cliff S
Is there a way to combine or merge OO writer macros to work as one macro? I have a large group of documents that I wish to modify either in full or in parts. For example I have a different macro to Boldface text, change a font, delete a Date. I would like to run them as one macro. I am unable to find a capability to edit a macro.

Re: OO Writer Macros Usage

PostPosted: Wed Oct 30, 2019 6:42 pm
by RoryOF
You can Copy/Paste all your macros into a plain text editor, one after the other, then Copy/Paste the amalgamation back into the OO macro editor and add any extra code you need.

Re: OO Writer Macros Usage

PostPosted: Wed Oct 30, 2019 7:18 pm
by Zizi64
Please upload the parts of the macro code here.

Re: OO Writer Macros Usage

PostPosted: Wed Oct 30, 2019 10:21 pm
by JeJe
Write a macro that calls the other macros

Code: Select all   Expand viewCollapse view
sub runMacros1to3()
macro1
macro2
macro3
end sub

Re: OO Writer Macros Usage

PostPosted: Wed Oct 30, 2019 10:24 pm
by RoryOF
@JeJe: Wouldn't they all need to be in the same library? That is why I suggested amalgamating them into the one unit, which leaves the individual macros functional in their files, in case that is ever needed.

Re: OO Writer Macros Usage

PostPosted: Wed Oct 30, 2019 10:47 pm
by JeJe
Wouldn't they all need to be in the same library?


I'm not sure if that's a response to my post... but if the macros are in different documents then yes you may need to put them somewhere like the My Macros / Standard Library: you can't call a macro in one document from another document.

(If the macro is already in My Macros/some-library-name - then so long as the other library is loaded you can call the macro in it)

Re: OO Writer Macros Usage

PostPosted: Wed Oct 30, 2019 10:49 pm
by RoryOF
I edited my post to make it clear it was a reply to your post, JeJe.

Re: OO Writer Macros Usage

PostPosted: Thu Oct 31, 2019 3:43 pm
by DiGro
I did the same with some macros of mine

I subsequently ran the macros be calling them from the previous executed one.

So macro 1 calls macro2, then macro2 calls macro3 etc...

Call the next macro just before closing the executed one, something like:
Code: Select all   Expand viewCollapse view
previous executed code.....

Call SubMacro2()

End Sub


You can edit macros by using Tools > Macros > Manage Macros > OpenOffice Basic.
That will bring you to the Basic IDE where you can make en edit macro's

Re: OO Writer Macros Usage

PostPosted: Thu Oct 31, 2019 11:04 pm
by Cliff S
Hi RoryOF At this point I believe that you had the best solution offered. Unfortunately I can't actually test it as another problem has occurred preventing testing it. The macro record function has ceased working. When I try and record a new macro it is no longer saving it. When I click save it appears to work and gives no error message or code. When I try to run that macro it does not appear in any of the folders. I'm going to have to solve this problem first. Also I checked the macro security function and found its set to medium. Tnx

Re: OO Writer Macros Usage

PostPosted: Thu Oct 31, 2019 11:19 pm
by RoryOF
The OO Macro recorder is rudimentary; a recorded macro will often need to be hand edited to put the detailed functionality into it from the OO API information or the OO BASIC manual.

A quick search suggests that the macro recording functionality is only available for text documents in OOo Writer and for spreadsheets in OOo Calc. I cannot say how accurate this information is.