02 December, 2007

Command Line OpenOffice Macro Execution

First start by creating a new macro, something simple.

Create the macro by selecting Tools->Macros->Organize Macros->OpenOffice.org Basic

Edit a new Macro1 in Module1

Define the Macro1 as below:

Sub Macro1
MsgBox( "Hello World" )
End Sub

Save it and execute it from the command line by:

$ soffice macro:///Standard.Module1.Macro1

You can run OpenOffice headless by specifying the -invisible argument.

$ soffice -invisible macro:///Standard.Module1.Macro1

No comments: