Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 
share|improve this question

migrated from superuser.com Feb 12 '11 at 19:42

This question came from our site for computer enthusiasts and power users.

What about running a macro from a specific file? What would be the path to be used for invoking the macro in such a case? – anoopjohn Dec 25 '12 at 17:58

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")
share|improve this answer

Create an event-driven macro assigned to the Open Document event for a particular document or a common document. Then you would load the document by itself to act on itself or load it along with other documents to act on one or more of them. This is along the lines of the idea of an auto-run macro.

share|improve this answer
So, wht would the command line be to invoke an event-driven macro assigned to a common document to apply it to the document MyDocument.odt? – C.W.Holeman II May 19 '10 at 5:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.