How to invoke an Openoffice macro from the Linux command line

command linemacroopenoffice

I have an OpenOfice macro that I want to use to process the contents of an OpenOffice file. I am able to do this by opening the file with OpenOffice and then running the macro. How do I invoke the macro from the Linux command line without using the GUI? Something like:

$ oowriter -headless -o MyDocument.odt -RUNMACRO MyLittleMacro 

Best Answer

The flag you want is -invisible. See this example, adapted from http://ubuntuforums.org/showthread.php?t=786697

ooffice -invisible macro:///Standard.Module1.SaveAsXHTML("/tmp/somefile.rtf")
Related Question