Difference between revisions of "User:Nnino/Drafts/OOo Macro Tutorial"

From Apache OpenOffice Wiki
Jump to: navigation, search
(first draft created)
m (Record a macro: typo)
Line 12: Line 12:
== Record a macro ==
== Record a macro ==
(see [[Documentation/OOo3_User_Guides/Getting_Started/Creating_a_simple_macro|instructions in GS2]])
(see [[Documentation/OOo3_User_Guides/Getting_Started/Creating_a_simple_macro|instructions in GS3]])
== Write macro code from scratch ==
== Write macro code from scratch ==

Latest revision as of 18:29, 22 July 2010

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[1]. 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,


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