Included material
Many excellent macros are included with OOo. Use Tools > Macros > Organize Macros > OpenOffice.org Basic to open the Macro dialog. Expand the Tools library in the OpenOffice.org library container. Inspect the Debug module—some good examples include WritedbgInfo(document) and printdbgInfo(sheet).