OpenOffice.org Macro Information

By

Andrew Pitonyak


HOMEBookConferencesOpenOffice.org MacrosDatabaseCodeSpamPerlMy Perl Utilities4NT batch filesVYM

Andrew Pitonyak's OpenOffice Macro Information

My OpenOffice.org Macro document (updated July 1, 2009 02:33:18 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 OpenOffice.org Macros Explained. You can look at my book 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 March 10, 2005 04:56:11 PM EST) that inspects fonts. I also have a PDF version of the document. The new document requiers OpenOffice.org 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 "site:api.openoffice.org 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: http://api.openoffice.org/docs/common/ref/com/sun/star/text/XWordCursor.html I want to see what else might be related under "com.sun.star.text" so I replace "XWordCursor.html" with "module-ix.html" to see all of the modules for "com.sun.star.text". If you just want to browse, a good place to start is: http://api.openoffice.org/docs/common/ref/com/sun/module-ix.html

My Main Downloads

Document Updated Description
Database Macros Most of my database related content is on the database page.
English Macro Document July 1, 2009 02:33:18 PM EDT This is my main macro document that contains numerous examples and explanatory text.
PDF English Macro Document July 1, 2009 02:48:31 PM EDT This is my main macro document that contains numerous examples and explanatory text.
CodeFormatter.odt November 10, 2007 07:31:11 PM EST My macro library to format C++, Java, and StarBasic. It is easier to use the add-on to install the library, but this document contains descriptive text of what I have done. Download them both!
CodeFormatter Add On 1.0.0 November 10, 2007 07:31:41 PM EST Add On to to format C++, Java, and StarBasic.
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 July 30, 2007 05:48:27 PM 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 March 10, 2005 04:56:11 PM EST Demonstrates how to inspect fonts using macros. You can create font summaries and font lists.
PDF Font Document March 10, 2005 04:56:13 PM EST 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 July 1, 2009 02:36:44 PM 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.
Deutsches Ü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 http://buhcia.narod.ru

Useful Macro Links

There is a wealth of information available on-line that help decrypt the initially difficult paradigm. 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 has 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
Original Documentation Last time I checked, you could download the original Sun documentation
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.
Good Examples Collections of macros, scripts, StarBasic, and information related to OpenOffice. Lots of spreadsheet related macros here.
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!
Document Examples If you want to count words correctly, or do a few other things in a write document, this is the site for you.
How To Convert If you want to know how to use macros to export or convert documents of most types, go here. This is a fabulous site for this sort of thing. I am simply amazed at the work involved.
OOoMacros.org This site contains some nice macro examples.
Mackmoon Help Links This has help links for numerous userful things in OpenOffice.org. It is useful to browse these links just to see what is available. Excellent site!
8 Days A Week Can't download a copy of OpenOffice.org, you can order a copy here. They have other OOo related things as well.
distribution.openoffice.org A very complete list of locations that you can order a copy of OpenOffice.org if you can not easily download it on your own.

Other Stuff

If you desire other information, I found a set of links that can get you started on many different aspects of OpenOffice. Highly Recommended as a general site.
Valid XHTML 4.0! Last Modified October 12, 2008 07:01:09 PM EDT© 1999-2009 Andrew Pitonyak (email me at: andy @ pitonyak.org)