User:Nnino/Drafts/OOo Macro Tutorial

From Apache OpenOffice Wiki
< User:Nnino‎ | Drafts
Revision as of 18:29, 22 July 2010 by Nnino (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

Overview

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,


References

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