User:Nnino/Drafts/OOo Macro Tutorial

From Apache OpenOffice Wiki
Jump to: navigation, search

Purpose of this draft tutorial is to get started with macros without having to read the whole macro chapter from the Getting Started Guide.


A macro is a saved sequence of commands or keystrokes that are stored for later use. macros are usually written in a language called StarBasic (just abbreviated Basic). Some other programming languages are supported as wellNeedsReference.

To generate a macro, you can record a couple of keystrokes[1]. Or you can write the macro code yourself from scratch (or paste it from a code source).

In, macros are stored in modules, and modules are stored in libraries, and libraries are organized in library containers (default containers are called "My Macros" and " Macros"). The container reflects the scope of the macros contained. So the libraries in "My Macros" are visible for the current user, while libraries in " Macros" are visible for any user of this particular OOo Installation. In addition, macros can be stored in ODF documents, so each document can act as a separate library container, too. For further reading, see chapter Macro organization of Getting Started Guide.

Record a macro

(see instructions in GS3)

Write macro code from scratch

First create a new Module in the Standard library of the "My Macros" container. In the main menu, choose Tools > Macros > Organize Macros > Basic,


  1. as described in this chapter of the Getting Started Guide
Personal tools