Better word counts for OpenOffice.org

By   |  June 14, 2004

If you\’re a writer, or indeed anyone that works with words on a regular basis, you may have bumped your head against one of the more significant, in my opinion, ommissions from OpenOffice.org: the lack of a selection-based word count feature. By default OpenOffice.org includes the \”properties\” dialogue which offers general parameters for the document at hand including the total number of words in the document. But what if you need to calculate how many words are in a particular paragraph? Short of manually counting all the words in the paragraph you can\’t. Unlike many other word-processing applications it is not possible to simply highlight the words and do a word count.

There is, however, a workaround which, until the suite includes its own selected-word count, is more than adequate for the job. It is in the form of a macro which can be opened in OpenOffice.org and installed along with a menu button and a shortcut key. The original macro was written by Andrew Brown. Thanks to www.openoffice.org.za for bringing this macro to our attention. The description below is intended for OpenOffice.org1.1.0 users although it will work on OpenOffice.org 1.0.

To install the word count feature, download a copy of the installer file: installer_acb.sxw

Close all OpenOffice.org documents. Now open the installer file that you have just downloaded in OpenOffice.org.

When the file opens it will warn you that it contains macros. Click \”run\” to continue opening the file.

Read through the document which explains the workings and the tools included. Then click on the red-highlight bar named \”Press here to install everything…\”. The installer will go to work and a few pop-up windows will alert you as to what is going on. When that is done close OpenOffice.org entirely, including the quickstarter if you are using it.

Re-start OpenOffice.org writer and verify that the macro is installed by clicking on tools -> macros -> macro…

Under the \”soffice\” module you will see \”acbTools\”. If you double-click \”acbTools\” you will see a number of modules including \”Wordcount\”. Select \”Wordcount\” and you will see four scripts. If this is correct then the macros have been installed correctly.

Click \”close\”.



To add a menu button for the word count macro open the view -> toolbars -> customize menu option. Under the \”available buttons\” window select \”OpenOffice.org BASIC Macros\”. Now select \”acbTools -> Wordcount -> Main\”. Now choose a toolbar to add the button to – the best options here are \”function\” toolbar or the \”main\” toolbar. Click \”Add –>\” to move the macro to the toolbar. To position the macro button on the toolbar use the \”Move up\” and \”Move down\” buttons. Finally, click on \”Icons…\” and select an icon for the button.



To add a shortcut key for the word count macro open the Tools -> Configure menu. In the dialogue box that opens up, select the keyboard tab. In the \”shortcut key\” list find the key combination you want to use for the macro. For example find the one of the function keys or a combination you want to use. Select this key combination and in the \”Category\” list under the \”Functions\” window, select \”OpenOffice.org BASIC Macros\”. Now select and open the following: \”abcTools -> Wordcount -> Main\” (in the function window) and click the \”modify\” button. The key combination you selected will appear in the \”keys\” list. Click \”OK\” to complete the process.

That completes the installation. Open a new OpenOffice.org writer document and try out the new function.



This particular macro in fact goes beyond just a simple selection-based word count but also pops up a window with the total number of words, the selected number of words as well as the number of non-selected words. Particulary useful is the added ability to select multiple portions of a document and count the words in those.

Comments

2 Responses to “Better word counts for OpenOffice.org”

  1. Andrew Brown
    June 15th, 2004 @ 12:00 am

    Thank you for this nice plug. I should point out that the macro counts selections and footnotes, but neither count is guaranteed to be accurate. There are warnings about this in the code, but if you use all the installer goodness, you will never see them. In the end, I made the tradeoffs between speed and accuracy that suited me.

  2. linda martindale
    June 22nd, 2004 @ 12:00 am

    yay

    i am a journalist who uses openoffice (and loves it) except for that \’bang your head against the wall wordcount thing\’.

    so really appreciate this pearl of wisdom and knowledge :-)

Comments are closed