Official website for Linux User & Developer
FOLLOW US ON:
Mar
17

Optimise OpenOffice.org

by Sukrit Dhandania

OpenOffice.org is the greatest open source alternative to Microsoft’s Office suite. Over the years OpenOffice has evolved to become much more than just an alternative to MS Office however. Let’s look at some hacks that will allow you to become more of a power user of OpenOffice, enabling you to be more productive with the software. We’ll explain how to create your own macros and extensions and more besides…

OpenOffice.org  is the greatest open source alternative to Microsoft’s Office suite. Over the years OpenOffice has evolved to become much more than just an alternative to MS Office however. Let’s look at some hacks that will allow you to become more of a power user of OpenOffice, enabling you to be more productive with the software.OpenOffice Folder

Resources:
OpenOffice (version 3 or higher)
BasicAddonBuilder
Sun PDF Import Extension
Professional Template Pack II – English
Writer’s Tools
OpenOffice.org Document Templates

OpenOffice.org Macro Feature
A macro in OpenOffice is a saved sequence of steps or commands which can be called with the click of a button. Macros are very useful in making repetitive tasks a lot more efficient. Say you need to put your signature, address and company logo at the end of a number documents you create using OpenOffice. You can create a macro that does this for you. This way, all you have to do is to call the macro and it will fill in the necessary information. Creating macros might seem rather intimidating at first, but it is quite simple to get started with it.

Record a macro
The simplest way to create a macro is to use OpenOffice’s built-in macro recording tool. You launch the macro recorder, run the steps you want to be recorded in the macro, then stop the recorder. Voilà, your macro is now ready. Let’s look at how to do this. Go to Tools>Macros>Record Macro, then press the sequence of keystrokes you want. At the end of your sequence, click on Stop Recording. In the new window that pops up, give the file a name and save it. Try to come up with apt names for your macros, as weak names will drive you nuts in the future.

Run your saved macro
Once you have saved a macro in OpenOffice, it’s quite simple to run it. Go to Tools>Macros>Run Macro. A window will pop up with a list of all the macros available, the ones from the OpenOffice.org team, as well as the ones created by you. Select the macro you want to execute and hit Run. The macro will execute. Errors, if any, will be displayed in a pop-up notification window.

Extensions
If you create a macro that you want to share with other users of the OpenOffice suite, there are two ways for you to do that. You can either share the code used by the macro, or you can package the macro into an ‘extension’ and then share it via email or put it up for download. The second method is usually the better approach. Let’s look at how to package an OpenOffice macro into an extension.

An OpenOffice extension pretty much consists of the code of an OpenOffice macro and some XML files, all wrapped up into a zip file. To create an extension, first follow the steps shown above and create an OpenOffice macro. Once you have the macro saved in OpenOffice, there are two ways you can proceed. You can either write the necessary XML files manually using a text editor, or you can use the OpenOffice tool, BasicAddonBuilder (BAB), to generate the XML files for you. Let’s look at the second method.

Install the BasicAddonBuilder
Installing the BasicAddonBuilder is quite a straightforward process. – just start here. This is the page for the BasicAddonBuilder OpenOffice extension. On this page, click on the ‘Get it!’ button to begin the installation of BasicAddonBuilder. Once the download is complete, OpenOffice’s extension system will take over the installation. Just follow the steps that it asks you to and you should soon be in business.

Pages: 1 2 3
  • Tell a Friend
  • Follow our Twitter to find out about all the latest Linux news, reviews, previews, interviews, features and a whole more.
    • A. Lurker

      You missed the biggest tip of all: How to properly print to an envelope. I have the vanilla-ist of printers; an HP Laserjet 4. I have looked at maybe a dozen web articles telling me how to print envelopes in Openoffice and none of them worked. Printing in Slackware 7.1 to my Deskjet 520 worked better than this. Printing to envelopes; now there’s a story for you.

    • anonymous

      i have opened 10 tickets with open office so far since it was star office and it cannot do basic new line search and replace.
      10 times my ticket was closed in 10 years telling me its not important feature that needs attention

    • http://descasa.i.ph Silverlokk

      Find, More options, Regular expressions does it, although you do have to know regular expressions. OTOH, how would you search for new lines in MS Word?

    • http://descasa.i.ph Silverlokk

      BTW, in keeping with the spirit of the article: I would take a text file which has new lines between lines, and two new lines between paragraphs, and record a macro that would have new lines only between paragraphs. Take a README file, for instance. Anyway, first thing to *before* recording is check the Edit > Find dialog to see if it does Regular Expressions. Depending on your preferences, you may leave that box unchecked first, and let the macro take care of checking it upon start, then unchecking it when it exits. Or, if you keep it checked, you’ll record the macro from the time you do the Edit > Find.

      Enter \n\n in the “Search for: box, and ~!~ in the “Replace with” box, then click on the Replace All button. That replaces all the double line feeds with the string “~!~”. I’m doing this because I’ll replace single occurrences of \n with a space. If my first find-and-replace was for the single occurrences of \n, paragraphs would run into each other.

      The Search-and-replace dialog box stays on-screen. Now, Enter ~!~ in the “Search for” box, and \n\n in the “Replace with” box, then click on the Replace All button. That one breaks paragraphs with two line feeds.

      If you prefer to keep Regular Expressions disabled, uncheck the relevant check box. Close the Find-Replace dialog box, stop the macro recording.

      One thing I haven’t checked is the effect of paragraph styles on the macro. Like, in my default style sheets, I have two line feed between paragraphs. If that’s also the case for your default style sheet, your replacement string for ~!~ will be a single \n.

      As to the ~!~ thingy, I chose that on the assumption that text normally wouldn’t contain that character. Might be safer to use a longer string, e.g., ThisStringIsTemporaryParagraphBreak — since this is a macro, you’ll be doing that only once anyway :)

    • http://descasa.i.ph Silverlokk

      Sorry, forgot an important step. After doing the search-and-replace of \n\n with ~!~, next enter \n in the “Search for” box, and a single space in the “Replace with” box, then Replace All. After this, Search for: ~!~, then Replace with: \n\n, etc…

    • http://descasa.i.ph Silverlokk

      Update: my style sheet automagically inserts two line feeds between paragraphs, so when I do the last step of the macro-to-be , I only need to replace the ~!~ with a single \n. Of course, I recommend a style sheet if you consistently want two line feeds between paragraphs, and to save it as the default style.