Problem solve Get help with specific problems with your technologies, process and projects.

Mail merge workaround

An office suite expert describes how to turn text files into spreadsheets and how to create a database based on a text file in OpenOffice.

As an educator of secondary students, I am very keen to show students OpenOffice and, indeed, recommend it to be used at home. Students are familiar with Microsoft Word. As a government school, we get corporate licenses to use with it. OpenOffice is a viable alternative, but falls short (in my experience) in the area of the mail merge.

For example, take a .csv file of 1000 records and students are expected to produce different multiple-page mail merged results from the 1000 records (e.g. filter on a class=maths and year=8, if there are 120 students here). Then, you must demonstrate how you can produce a single OpenOffice file (.odt file) of 120 pages. Students should be able to quickly use the filter to change their selection criteria (e.g, class=english and year=10 should produce a single 140-page .odt file ready for printing at a later date).

The above exercise (which, by the way, is the most common use of the mail merge in schools) I've found to be cumbersome and buggy with OO. I'm reluctant to say it, but the wizard in MS Word is much better and much more intuitive than the OO wizard. Can you recommend a good workaround?

I actually like the OpenOffice.org mail merge. It is designed, true, to provide capabilities more so than to make it obvious how to do the most common tasks. Generally, though, you can do nearly anything; it just might take more time and more hoops.

Here are the steps for doing a simple mail merge based on a spreadsheet or text files. You can also find out how to suppress an empty Address2 field.

There is a bug related to text files that has been reproduced and is being worked on. You can vote for the issue to be worked on. You can get around the bug by listing numeric values first, starting at the left, since any text value to the left of a numeric value will be shown as 0, rather than the correct value. Alternately, paste the text file into a spreadsheet to avoid the bug.

Regarding the specific situation you present, it sounds more like filtering than mail merge per se. I'm not sure mail merge is actually necessary, though I might not be understanding the example. I would suggest making the text files into spreadsheets. Choose File > Open, in the file format list select Text CSV, select the text file and click Open. Verify the delimiter in the window that appears, then click OK and save the spreadsheet. Or, copy and paste the text file into a spreadsheet. Once the data is in the spreadsheet, you can use spreadsheet tools to create a filter (Tools > Filter > Standard Filter) and print the results from the spreadsheet. (To remove the filter, click in the upper left cell in the shown results and choose Tools > Filter >Remove.)

For printing options, choose Format > Page, Sheet tab, or set page breaks under View > Page Break Preview.

Another option is to make a database, based on the text file. Then, use the query tool to restrict the data and use the reports tool to print. Open the .odb file that points to the text file, click the Queries icon and make the query from a wizard or in Design View.

You can then generate a report from that. In the same main window for the .odb file, click the Reports icon and create a report from the query.

Dig Deeper on Linux servers

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.