Macro Information


Andrew Pitonyak MacrosDatabaseSpamPerlMy Perl UtilitiesVYMMisc

Andrew Pitonyak's OpenOffice Macro Information

My Macro document (updated June 14, 2014 06:27:00 PM EDT) contains many examples. This document is updated frequently so check back frequently. When you find errors, please inform me. Be certain to check out my book Macros Explained. You can look at my book page.



This article is translated into the Czech language for CzechLib community (electronic knowledge database). Translated by Alex Novak from

Tento článek je přeložen do Česká jazyk pro CzechLib komunitu (elektronické databáze znalostí). Překlad Alex Novák z


This page has been translated into Bulgarian (see by Albert Ward. Thanks Albert, you did a great job!

Special Message: Albert, I have reason to believe that a few of me email messages to you did not make it to you. I believe that it is related to how my outgoing mail is usually processed. If you translate the paragraph above into Bulgarian, I will add the text to this page.

Do You Have A More Complete Book?

My Book presents material in an organized fashion designed to teach you the material as you read. My free macro document, on the other hand, is a less organized collection of examples with little explanatory text. If you want to learn and see many of the details with complete working examples, buy my book. If you want a large collection of miscellaneous examples, download my macro document. There is very little overlap between the examples in the book and the examples in my macro document, so you probably want both.

I want to know more about fonts

My macro document is becoming rather large, and I wanted to include information concerning fonts. I opted to create a document (updated July 17, 2013 09:14:29 PM EDT) that inspects fonts. I also have a PDF version of the document. The new document requiers version 2.0 or later to run.

The document can create a summary of the supported fonts with an example of how the font looks. A listing of the font descriptor can be written to a Calc document. Tables that show the characters with ASCII values from 32 to 255 for every font in the system.

Feed Back

If you have good examples to include in my document, send me an email. I welcome constructive criticism and examples.

How Do I Obtain Help?

If you have questions about macro programming in OpenOffice I recommend that you:
  1. Check existing online resources to see if you can find solutions.
  2. Post your questions on the dev mailing list. This allows the entire community to think about and help you solve your problems. There are smart people with a lot of experience who frequent the list and many of them know things that I do not. It is better to obtain a quick, free, existing solution than to wait for me to solve the problem.
  3. Although I am flattered by the many requests for help with OpenOffice Macros, I do not have time to handle all of the requests that I receive. For this reason, I prioritize the requests. My paying clients come first.

How I Find On-Line Information

When I want to know about a specific issue, I usually search the Developers Guide, the tutorial, and then finally a google search. If I want to know something about cursors, some posible searches include "Cursor OpenOffice", "XCursor OpenOffice", and " Cursor". The last search is one of my favorites.

If I already know something about the class, service, or interface that interests me, I can sometimes go directly to the API web site. Assume that I started with a web search and found the web site on word cursors: I want to see what else might be related under "" so I replace "XWordCursor.html" with "module-ix.html" to see all of the modules for "". If you just want to browse, a good place to start is:

My Main Downloads

Document Updated Description Macros Explained.odt October 24, 2014 09:33:51 PM EDT Starting on a third edition. Will see if this works out or not. Macros Explained.pdf October 24, 2014 09:35:19 PM EDT And here is the PDF version.
OOME_3_0_deutsch.odt Dies ist die deutsche Übersetzung meines Buches. Siehe
OOME_3_0_deutsch.pdf Dies ist die PDF-Version der deutschen Übersetzung. Macros Explained.pdf October 24, 2014 09:35:19 PM EDT And here is the PDF version.
Database Macros Most of my database related content is on the database page.
English Macro Document June 14, 2014 06:27:00 PM EDT This is my main macro document that contains numerous examples and explanatory text.
PDF English Macro Document June 14, 2014 06:27:33 PM EDT This is my main macro document that contains numerous examples and explanatory text.
Incomplete comments on VBA July 30, 2007 05:36:59 PM EDT Some years ago, I compared VBA and OOo Basic based on the language syntax. I never finished.
PDF Incomplete comments on VBA July 30, 2007 05:37:07 PM EDT Some years ago, I compared VBA and OOo Basic based on the language syntax. I never finished.
My Macro Libraries June 7, 2014 12:28:36 AM EDT A collection of my personal macro libraries. Assume that these are not tested and will destroy everything on your system. My most used macros are the Inspect() macro in the Pitonyak lib, and the macro formatting macro.
Font Document July 17, 2013 09:14:29 PM EDT Demonstrates how to inspect fonts using macros. You can create font summaries and font lists.
PDF Font Document July 17, 2013 09:14:31 PM EDT A PDF version of AndrewFontMacro.odt. Obviously, the PDF version does not contain push buttons that can automatically run the macros.
Dialog Examples July 16, 2003 06:52:09 PM EDT My macro document contains a section on forms. I show how to use most of the control objects. This document is the dialog example mentioned in my macro document. This will show all of the methods, properties, or services of a given object.
Document Template June 7, 2014 12:04:10 AM EDT This is the template that I use in my macro document. Although you do not need this template, I have received numerous requests for this document. If you do not have this template on your system when you open the document, OpenOffice will ask if it should look for the template the next time that the document is open. If I change the template, the changes will be reflected in the macro document. If you do not understand how this powerful feature works in OpenOffice, you should learn all about it.
Deutsche Übersetzung Makro-Dokument June 29, 2003 09:54:31 PM EDT Dieses ist eine deutsche Übersetzung meines Makrodokumentes. Die Übersetzung erfolgte durch Muttersprachler. Mein Hauptdokument enthält mehr Informationen als die deutsche Version, weil es neuer ist.
Traduction Française Voici la traduction française de mon document, effectuée par le projet Documentation de la branche française d'OpenOffice sous le nom de "Eléments de programmation des macros dans OOo". Mon document original contient plus d'informations car mis à jour depuis la dernière traduction. Ce lien vous mènera directement sur la page Web contenant cette traduction.This link will take you to a French web site that contains a French translation of my document.
Russian translation of AndrewMacro.odt. October 14, 2007 02:20:34 PM EDT Russian русский (Russian translation) Макросы OpenOffice, first draft. See

Hosted Material

Material was sent to me, so I am hosting it here...

I used the explanations provided to me by the authors.

Document Updated Description
Form Utilities October 10, 2010 04:53:51 PM EDT Allows you to use the enter key to move through a form rather than using the TAB key.
Data Input October 10, 2010 04:53:51 PM EDT Gotes to only white (1677215) cells in a range (instead of the default -1). Great way to use the sheet as an input form.
Time Functions October 10, 2010 04:53:53 PM EDT Custom function to determine elapsed time in hours for payroll and similar. Uses a period instead of the colon so that time can be entered without using the shift key.
Cash Register October 10, 2010 04:53:52 PM EDT A cash register that the author of this macro used with his Address Barcode reader.
December 31, 1969 07:00:00 PM EST
December 31, 1969 07:00:00 PM EST

Useful Macro Links

Here are some links and references:

Document Description
ooRexx Nutshells Diploma work by Josef Frysak, under the watchful eye of Rony G. Flatscher, titled "Automating Open Office - ooRexx Nutshells". If you want to know how to use ooRex to access OOo, this has numerous excellent examples. The document also contains significant background material that is useful, even if you are not using Rex.
Using Visual Basic A quick quide to using VB to access OpenOffice.
Main OpenOffice Site Primary OpenOffice website, complete mailing lists and downloads
OpenOffice API Site This site takes some getting used to but it is very complete
Sun had a macro programming book. An excellent book. This is probably the place to start for free materials. A warning, however, this contains the same errors as the included help documentation. One problem that I noticed after quickly skimming the book is the problems with the case statements are still there. That said, someone spent a lot of time and did a pretty good job.
tutorial.pdf Excellent document on using macros.
DevelopersGuide This has information about the developers guide including how to download it as a pdf file. Although this document can be difficult and daunting, it is an excellent resource.
OpenOffice Documentation Site A good place to start when looking for documentation
How_to_use_basic_macros.sxw If you want to embed macros in your document and interact with buttons and such, this is your document
Uno Development Kit Learn all about the Uno Development Kit
One of the top level module links. A good place to start if you want to traverse the infrastructure.
Developer Guide Examples When a smart man decides that the JAVA examples in the developers guide should be available in Basic, this is what you get!
8 Days A Week Can't download a copy of, you can order a copy here. They have other OOo related things as well.

Valid XHTML 4.0! Last Modified October 24, 2014 08:45:55 PM EDT© 1999-2014 Andrew Pitonyak (email me at: andy @