OOo Off the Wall: Fielding Questions, Part 4 - Mail Merges
Mail merges are a means of using fields to create multiple copies of a document. They got their name because one of the most common uses for the tool is to address letters to different destinations. However, the same process can be used for other purposes as well, such as personalizing a form letter. If you choose, you even could use mail merges as a form of conditional text. Of all the uses fields have in OpenOffice.org Writer, mail merges is one of the most useful--and the most complicated.
In the version 2.0 beta, merges theoretically became simpler with the addition of the Mail Merge Wizard to the Tools menu. In practice, however, the wizard's usefulness is limited. It's designed specifically for merges that address letters or, assuming that you have Java Mail installed on your system, e-mails. Other merges still have to be done manually or with the older wizards for faxes, labels or business cards.
Moreover, although you can puzzle through any of these wizards without fully understanding merges, you can use them more efficiently if you first try to do a few without a wizard. Working without the wizard helps you understand the three parts needed for a mail merge and how they work together.
Mail merges require three separate documents:
The data source: a database, a spreadsheet or a Mozilla or Thunderbird address book that contains various information. In version 2.0, OOo refers to all these types of documents as databases, but keeping the distinction between data sources in general and true databases seems less confusing.
The source document: a Writer document with mail merge fields added from Insert > Fields > Other > Database. The mail merge fields are placeholders that indicate what fields from the data source are used. You can use other fields to signal how information from the source document should replace the mail merge fields.
The target document(s): a Writer document(s) produced when the mail merge is used. The target document(s) replaces the mail merge fields with information from the data source. Target documents are sent to the printer or saved as files.
Before you begin a merge, all three of these items need to be set up.
Before you can use a data source, you must register it with OpenOffice.org. Prior to version 2.0, data sources were registered from Tools > Data Sources. However, as of version 2.0, they are registered using File > Tool > Database and a different interface.
In addition, in previous versions, the original data source file appears to have been registered with OOo. In version 2.0, information from the data source seems to be extracted from the source file to create a new database using the new Base format (.odb) in your home directory.
To register a data source in version 2.0:
Select File > New > Database. The Database wizard opens.
Select the Connect to a New Database button. The Database Type drop-down field becomes available.
Select the type of data source from the Database Type field. Almost any sort of proprietary or open-source database can be used, providing that it has either ODBC or JDBC connectivity. You also can use Thunderbird or Mozilla address books, spreadsheets and text files. Both spreadsheet and text files can be formatted in any manner supported by Writer, including MS Office files. A text file, however, requires a consistently used de-limiter to designate rows and columns. It is worth using only if you don't have another way to record data.
If you are unfamiliar with databases and have under 1,000 records, a Calc spreadsheet probably is the most useful type of data source. You can use a spreadsheet with more records, but be prepared for delays in opening and saving the file.
Click the Next button to continue.
Enter the path to the data source. If it has a password, click the Password required box. Then click the Next button to continue.
Click the Yes, register the database for me button, followed by the Finish button.
Enter a name for the new database and then click the Save button.
The new database has been created and now is available for use.
-- Bruce Byfield (nanday)
Getting Started with DevOps - Including New Data on IT Performance from Puppet Labs 2015 State of DevOps Report
August 27, 2015
12:00 PM CDT
DevOps represents a profound change from the way most IT departments have traditionally worked: from siloed teams and high-anxiety releases to everyone collaborating on uneventful and more frequent releases of higher-quality code. It doesn't matter how large or small an organization is, or even whether it's historically slow moving or risk averse — there are ways to adopt DevOps sanely, and get measurable results in just weeks.
Free to Linux Journal readers.Register Now!
- Three More Lessons
- Django Models and Migrations
- August 2015 Issue of Linux Journal: Programming
- Hacking a Safe with Bash
- Secure Server Deployments in Hostile Territory, Part II
- The Controversy Behind Canonical's Intellectual Property Policy
- Huge Package Overhaul for Debian and Ubuntu
- Shashlik - a Tasty New Android Simulator
- Embed Linux in Monitoring and Control Systems
- General Relativity in Python