I have a lot of ODT files and would like to apply the same macro code to them. I don’t want to open the ODT files and paste the macro code manually.
Given the basic macro code is in myBasicMacroCode.txt, what is the command line to tell libreoffice writer to run myBasicMacroCode.txt in ODT file?
I’m running LibreOffice 126.96.36.199 430m0(Build:2).
I want a command line or some kind of automate process that I can call because I have thousands of new odt files to process every other weeks.
What I found is you can execute the macro code as follows
libreoffice --headless "macro://./Standard.Module1.YOUR_MACRO" yourfile.odt
But there is catch, YOUR_MACRO needs to exist in yourfile.odt.
If you someone can tell me how to inject automatically the macro code in the odt file, then it will solve my problem.