User:Nnino/Drafts/OOo Macro Tutorial
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.
OpenOffice.org 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. Or you can write the macro code yourself from scratch (or paste it from a code source).
In OpenOffice.org, 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 "OpenOffice.org 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 "OpenOffice.org 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 > OpenOffice.org Basic,
- as described in this chapter of the Getting Started Guide