ePlaice / For the Best Software on the Net

Mainly Free and Open Source Software

Open Office Navigation

OOBase Database | OOCalc Spreadsheet | OODraw Vector Graphics | OOImpress Presentation | OOWriter Word Processor Using Mail Merge

Valid XHTML 1.1

Latest news

26 Mar 2008: OpenOffice 2.4 released with some improvements in functionality for writer e.g can now select rectangular block of text.

Links:

Open Office Writer

OpenOffice

This competes directly with Microsoft Word and provides some very nice features being based on open formats and in particular XML. This means that there are already conversion tools to transfer betwen Open Office and Microsoft Office.

After using Open Office for over a year now, I took the plunge and removed Microsoft Office from my PC, which was admittedly quite an old version, but nevertheless did the tasks I required. I now use Open Office for all my personal tasks and having converted my data files to the new file formats, I would not consider moving back to Excel or Word. This is not to say that Open Office is perfect, far from it, but it does mean I have sufficient confidence in it for letter writing and maintaining my spreadsheet finances. On the other hand when you start looking at some of the other modules such as the drawing package, you will quickly realise there are better open source alternatives. The database is much improved within Open Office, although again I prefer to use mySQL and use Open Office to make the connections.

OpenOffice XML Format

For Open Office Version 2 there has been a move away from the standard .sxw format to a .odt format. Both formats are open source, zipped and based on XML. However, the new Oasis standard is thought to have all references to Sun, Star Office and even Open Office removed because it is intended to be a true open format and will be used by other competing products. As you will have understood by now is that there are a multitude of different flavours of XML and this is because everyone wants to get on the bandwagon and try to dictate the standard.

Advantage of XML Format

With Word it is virtually impossible to get at the file formats and manipulate the data without having to use the application. Using writer it is quite straightforward. For example when you save a template as a .ott file, this is actually a zipped format. You can use a standard unzip to get to the basic XML file and then edit the XML file. When you have finished editing you can then zip it and then rename it back to a .ott file. Providing your edits are correct then you have a revised template file. Go to xml.com for some ideas on hacking Open Office documents.

Opening and Saving XML Documents

Because there are all these different flavours of XML, OpenOffice provides what they call filters to perform these tasks. So XML stands for Extensible Markup Language, XSL is the Extensible Stylesheet Language and XSLT is an Extensible Stylesheet Language Transformation, or sometimes referred to as XSLT style sheets. The new features allow you add filters to the application and modify existing filters. In addition you can specify a template file with your filter, that allows you to apply OpenOffice styles to an XML document that you import. This makes it a very powerful tool. It is possible to export a file to PDF, but you will need additional software to do this. I recommend an alternative approach to OpenOffice in my e-Books section that does not involve purchasing additional software.

Templates and Styles

A style is a named set of formatting instructions, so you can make parts of your document look and function alike with the application of a single named label, rather than having to laboriously hand-format each part of the document. Instead of having to remember that all your headings are 18-point Helvetica, you assign a heading style to each and let the machine format them for you. This is (a) lazier, (b) easier to change when Helvetica goes out of fashion, (c) going to let you build a table of contents simply by harvesting anything labeled as a heading, (d) going to make generating XHTML easy, and (e) highly recommended. It is possible to take the standard open office set of styles and create a new template containing the styles that you require for a particular document. The method involves opening a new open blank office text document and saving this as a template (.ott) file. The next step is to unzip the .ott file and rename the file styles.xml to old-styles.xml. Then create a .xsl file and name it add-styles.xsl containing all the new styles that you require. The next step is to run a transform which is fairly easy once you have a downloaded a little application called xmlstarlet. This is a batch application that can be run using the XP run command option that uses a MSDOS like emulator. Once you have created a new styles.xml then all that remains to be done is to zip the .ott file up again and then use this template for creating new documents. Then when you come to use the styles and formatting you will see the new styles in the lists.

Adding Styles Menu

This is achieved by creating a new dummy menubar using the on-line tools as follows :- Go to tools, customise, menus and press new for a new menubar item. Find out where this has been created by looking at the user config path detailed under Tools, options, writer, config. You will find a new file called menubar.xml. Re-name this file to old-menubar.xml. Then use a style sheet .xsl file containing the new menu items together with a data file of all names to generate a new menubar.xml file. Use xmlstarlet to process the transform. When successful you should see a new 'styles' menubar item that can be expanded to provide all the new styles. Before these work you must add a macro for each new style - see next section.

Using Macros

Writing a macro to call the various style functions is reasonably straightforward using the built in version of Basic. Other languages can be used including C and Delphi. The macro has to be incorporated in the styles template and this can be achieved by using File, Templates, Edit to allow a new version of the template to be saved. Then go to Tools, Macros, Organise Macros, OpenOfficeorg Basic and you will see a tree structure containing the template. Create a new module and then enter or paste the contents of the macro in the macro form. Then exit out of macros and finally save the revised template that now contains the macro. You can see where the macro is stored by looking in the unzipped template file for the path.

Where are Documents Stored?

The answer is that they can be stored in a number of directories as follows :- Templates are stored in c:\Documents and Settings\User\Application data\openoffice .org\user\templates Text documents are stored in My Documents.
Sample documents stored in c:\program files\openoffice.org.nn\share\sample\en-US.

Exporting to PDF

Writer does a very reasonable job of exporting an OpenOffice document to PDF format. It now even allows you to export hyperlinks and images. However, if you want to generate headings, bookmarks, layers, page numbers etc. then you need to look at alternatives.

Creating Forms

To be documented.

Creating Templates

One of the simplest methods of creating templates is to create a field of type placeholder. For example a field could be called postcode and if it is of type placeholder, format text then you can define the placeholder field as postcode and give reference information so that when the mouse hovers above the reference information could be 'Enter Post Code'. When the template is used the placeholder would be shaded and the reference hint would be displayed, so that the user just overtypes the actual postcode.

Migrating from Microsoft Office

So far I have not found any real problems converting from Word 6 or MS Office 2000. The only features I have noticed is that some of the templates get translated slightly differently and these are easily fixed. The other point is that macros written in MS visual basic naturally do not get translated to Starbasic, so if you are a heavy user of macros then this will prove to be a problem. The documentation claims that it will also be able to save and open documents in MS Office 2003's XML format, but I have not been able to test this.