OO Writer Macros Usage
OO Writer Macros Usage
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.
Last edited by MrProgrammer on Wed Oct 30, 2019 7:21 pm, edited 1 time in total.
Reason: Moved from Beginners forum to Macros and UNO API
Reason: Moved from Beginners forum to Macros and UNO API
Open Office 4.1.1 on Windows 10
Re: OO Writer Macros Usage
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.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: OO Writer Macros Usage
Please upload the parts of the macro code here.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: OO Writer Macros Usage
Write a macro that calls the other macros
Code: Select all
sub runMacros1to3()
macro1
macro2
macro3
end sub
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: OO Writer Macros Usage
@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.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: OO Writer Macros Usage
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.Wouldn't they all need to be in the same library?
(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)
Last edited by JeJe on Wed Oct 30, 2019 10:53 pm, edited 3 times in total.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: OO Writer Macros Usage
I edited my post to make it clear it was a reply to your post, JeJe.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: OO Writer Macros Usage
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:
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
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
previous executed code.....
Call SubMacro2()
End Sub
That will bring you to the Basic IDE where you can make en edit macro's
____________
DiGro
AOO 4.1.15 (Dutch) on Windows 11. Scanned with Ziggo Safe Online (F-Secure)
DiGro
AOO 4.1.15 (Dutch) on Windows 11. Scanned with Ziggo Safe Online (F-Secure)
Re: OO Writer Macros Usage
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
Open Office 4.1.1 on Windows 10
Re: OO Writer Macros Usage
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.
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.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS