OpenOffice.org comes with a macro language called Open Basic. I went looking for some documentation and found a very good tutorial as well as a list of links to other information at a site provided by Andrew Pitonyak called OpenOffice.org Macro Information.