SolutionBase: Converting Microsoft Office documents to OpenOffice documents

If you're considering making the switch from Microsoft Office to OpenOffice, you need to figure out what to do with all of those Office documents. Here are a few suggestions to help the transition.

Grow your Microsoft Office skills and keep time-saving and productivity-enhancing tips ready with TechRepublic's Quick Reference: Microsoft Office Pak - Download. Work more efficiently and help end users help themselves with these four reference charts covering Microsoft Excel, Microsoft Outlook, Microsoft Word, and Microsoft PowerPoint.

If you've decided to switch from Microsoft Office to OpenOffice, you might find yourself having to work with both Office and OpenOffice files. Fortunately, OpenOffice does a relatively good job of working with Microsoft Office documents. Here are several document-conversion tricks you can use when working in environments in which Office and OpenOffice are both used.

Opening an Office document in OpenOffice

Let's start with the basics. If you've recently adopted OpenOffice but have a bunch of documents that are still in Microsoft Office format, you'll probably want to be able to open the documents in OpenOffice. The good news is that OpenOffice can open Microsoft Office documents automatically. Just double-click on an Office file and OpenOffice will import it.

Although OpenOffice will open Microsoft Office files, not all Microsoft Office features are supported within OpenOffice. The odds of OpenOffice doing a perfect job of importing a Microsoft Office document depend on the complexity of the document.

If you import a fairly simple Microsoft Office document, you shouldn’t experience any problems. At the very most, you might have to do some minor reformatting. If you import a highly complex document, though, expect to have problems. OpenOffice will open any Microsoft Office document, but not all features will work as they did in Office.

One good example of this is Visual Basic scripts, which OpenOffice won't run. If you open a document containing VB script, you'll be able to view and edit the script, but you won't be able to execute the script from within OpenOffice.

If you're inexperienced with more advanced types of Microsoft Office documents, you might assume that Visual Basic script would be integrated into a document. However, Visual Basic script is the code through which Microsoft Office codes macros. Therefore, if you have macros incorporated into a Microsoft Office document, the macros won’t work if the document is opened in OpenOffice.

At first, the fact that OpenOffice doesn’t support macros probably sounds like a really big deal. However, the lack of support for macros doesn’t have to be problematic. For example, users often will open a document and make a small change that doesn’t even involve the macro. In such cases, OpenOffice will work perfectly for editing the document, and users who depend on macros will still be able to use them the next time the document is opened in Microsoft Office.

There are two ways OpenOffice can deal with Microsoft Office documents that contain macros. One option is to place the macros into a comment section of the document. This allows users to view or edit the macros, but not to execute them from within OpenOffice. The next time the document is opened in Microsoft Office, the macros will be active. The other option is to configure OpenOffice to delete macros when opening any Microsoft Office document containing them.

You can control the way OpenOffice handles macros within a Microsoft Office document by selecting the Options command from OpenOffice’s Tools menu. You'll then see the Options—Load / Save—VBA Properties dialog box. Expand the Load / Save container and select the VBA Properties container. This container offers options for loading basic code along with a Microsoft Office document, and saving the code back out to a document. The options can also be configured independently for Word, Excel, and PowerPoint documents.

Other features that are not supported by OpenOffice vary among document types. For example, a Word document may not be converted to an OpenOffice document correctly if it includes autoshapes, revision marks, OLE objects, indexes, tables, frames, multicolumn formatting, hyperlinks, bookmarks, WordArt-based graphics, animated characters, animated text, or certain other elements.

There are also some features in Excel documents that may not convert correctly, such as autoshapes, OLE objects, pivot tables, new chart types, conditional formatting, and certain functions and formulas. Restrictions also exist for PowerPoint documents, although not as many as for Word and Excel documents. OpenOffice has trouble converting PowerPoint documents that include autoshapes; tab, line, or paragraph spacing; master background graphics; grouped objects; and certain multimedia effects.

Exporting OpenOffice documents

If you're working in an environment where OpenOffice and Microsoft Office are both used, it’s only a matter of time before someone will want to open an OpenOffice document in Office. However, OpenOffice uses its own file format, which is incompatible with Microsoft Office. For example, if you create a word processing document in OpenOffice, the default file type is 1.0 Text Document (.sxw). Word doesn't offer an option to open a document that’s in .sxw format.

Fortunately, OpenOffice's Save As feature allows you to save your document in a variety of formats, including several Microsoft Office formats. For example, the word processor that comes with OpenOffice can save a document in Word 97/2000/XP/95/6.0 formats. RTF and text file formats are also supported, as are a variety of StarWriter formats.

Okay, so you probably didn’t need me to tell you that you could use the Save As feature to export an OpenOffice document into Word format. The simple fact that you can export OpenOffice documents in Microsoft Office format raises some interesting questions, though. For example, if OpenOffice is so picky about importing certain types of Microsoft Office documents, is it just as picky about exporting them?

What you have to remember is that OpenOffice does not offer all of the features that Microsoft Office does. At the same time, it doesn't really offer anything that Microsoft Office doesn't. Because all of OpenOffice’s features are supported by Microsoft Office, documents tend to export into Microsoft Office format with no problems (aside from possibly minor formatting issues).

Before I move on, there's one more export-related feature I want to show you. Unlike Microsoft Office, OpenOffice contains an option on the File menu that allows you to export a document in PDF. This is really handy if you ever need to post a document to the Web or distribute a document in a format that can’t be easily edited.

Maintaining compatibility with Microsoft Office

If you find yourself having to support an environment in which only a couple of people are running OpenOffice and everyone else is running Microsoft Office, you'll probably want to try to keep as many documents as possible in Microsoft Office format. One way of doing this is to configure OpenOffice so that it automatically saves all new documents in Microsoft Office format.

OpenOffice actually allows you to save files in Microsoft Office format by default. Just select the Options command from the OpenOffice Tools menu. In the Options—Load / Save—General dialog box, expand the Load Save portion of the Options tree and select the General container (Figure A). An option near the lower-right portion of the dialog box will ask what default format you want to save files in. The default configuration saves files in OpenOffice format, but you can save files in Microsoft Office format.

Figure A

You can configure OpenOffice to automatically save all documents in Microsoft Office format.

Mass document conversion

If everyone in your office is making the switch to OpenOffice, there’s a good chance that you have dozens of documents you'll want to convert to OpenOffice format. I'm happy to say that you don’t have to convert each document individually. OpenOffice has a batch conversion option that you can use to convert all of the documents at the same time.

The ability to import large numbers of documents is integrated into OpenOffice’s Autopilot feature. Autopilot allows you to import Microsoft Office documents and convert them to OpenOffice format. During the conversion process, the original documents are never modified. OpenOffice creates a completely new file for the converted documents. That way, if OpenOffice has trouble converting a document, the document will not be corrupted. You still have your original version to fall back on.

To convert a batch of documents, select the Autopilot | Document Converter options from OpenOffice’s File menu. You'll see a screen asking you what types of documents you want to convert. As you can see in Figure B, you're given a choice between converting Microsoft Office documents or StarOffice documents. After selecting the Microsoft Office option, you must select what types of documents you want to convert. You can convert Word, Excel, or PowerPoint documents, or any combination of these document types.

Figure B

You can convert Word, Excel, and PowerPoint documents.

Make your selections, verify that the Create Log File option is selected, and click Next. You'll now see the screen shown in Figure C. This screen is divided into two sections: Templates and Documents. Both sections have identical options, except that one set of options pertains to Microsoft Word template files (typically .dot files), and the other applies to Microsoft Office documents.

Figure C

The processes of converting documents and converting templates are controlled independently.

The first options in these sections are the Word Templates and Word Documents check boxes. These check boxes simply enable or disable the conversion of certain document types. For example, if you wanted to convert Word documents, but you didn’t want to convert Word templates, you'd select the Word Documents check box, but deselect the Word Templates check box.

The next option you'll find in both sections is the Including Subdirectories check box. If this box is selected, documents or templates will be imported from the specified directory and all of its subdirectories. Otherwise, documents or templates are imported only from the specified directory. One thing to keep in mind is that there's a separate Including Subdirectories check box for both sections. Therefore, it's possible to import documents from a designated directory and all of its subdirectories, but to not import templates found in those subdirectories (or vice versa).

Finally, both the Templates and the Documents sections have an Import From and Save To option. As I explained earlier, when you perform a document conversion, the original documents are never touched. By default, the converted documents are placed in the same folder as the original documents. However, you can save the converted documents in a different folder if you want. Once again, document conversion and template conversion are independent processes, and you can designate separate directory paths for each, if necessary.

Click Next, and you'll be asked to create any destination directories that don't already exist. You'll now see a screen that’s almost identical to the one shown in Figure C. The only real difference between the screens is that while the one shown in Figure C is dedicated to Microsoft Word documents, this screen is dedicated to Excel documents and templates. Aside from that, all of the options on this screen work the same as those you've already seen. Select your conversion options and click Next. You'll see one more screen like the one in Figure C. This time, however, the screen is dedicated to PowerPoint document conversions.

Click Next to open a screen detailing the conversion options you've specified. If everything displayed in the summary is acceptable, click the Convert button to launch the conversion process. Otherwise, you can backtrack by clicking the Back button.

When you start the conversion process, it will look something like the screen shown in Figure D. On my test machine, it took about a minute to convert seven two-page Word documents. When the conversion process completes, you can click Close to end the process. Before you do, try clicking the Show Log File button. As you can see in Figure E, the log displays the old and new names of each converted document. The log file also contains hyperlinks to both the old and new versions of each document. And, if you can’t remember the path you saved the converted documents to, you can hover the mouse pointer over a document name, and the document’s path will be displayed.

Figure D

This is what the document conversion process looks like.

Figure E

The conversion log file provides links to the old and new versions of each document.

Convert on the fly with file associations

If you want to convert files on the fly, you don't even need to bother converting the Microsoft Office files into OpenOffice format. Aside from the issues that I mentioned earlier, OpenOffice has no problem with opening Microsoft Office documents. In fact, if your users aren’t computer savvy enough to figure out how to open a Microsoft Office document in OpenOffice, you can help them out by associating the .doc, .xls, and .ppt file extensions with OpenOffice.

When you run the OpenOffice Setup program, you'll be asked if you want to associate these file extensions with Microsoft Office. Keep in mind that you'll see this prompt when you run the actual OpenOffice Setup program, not when you install from the MSI file. If you want to use an MSI file, but also want to associate these file extensions with OpenOffice, you'll need to do the extension association on the PC that you'll use to create the MSI file.

While leaving Microsoft Office documents in their native format is definitely the method that involves the least amount of work, it might not be satisfactory for your organization. Remember what I said earlier about OpenOffice not supporting Microsoft Office macros?

If a document contains a macro that you depend on, the only way you can use the macro within OpenOffice is to convert the document to OpenOffice format and then re-record the macro. Since you can’t include an OpenOffice-style macro in a Microsoft Office document, you may find that you don’t have any choice but to start converting documents to OpenOffice format.