mail merges - openoffice.org training, tips, and ideas · mail merge database – you need to let...

16
1 34 Mail Merges What Mail Merges Are and How They Work. . . . . . . . . . . . . . . . . . . . . . . . . . . page 2 Step 1: Setting up the Data Correctly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . page 5 Step 2: Creating a Database File That Connects to a File . . . . . . . . . . . . . . . . . page 6 Step 3: Creating a Mail Merge Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . page 8 Step 4: Printing Mail Merge Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . page 11

Upload: others

Post on 25-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

1

34

Mail Merges

• What Mail Merges Are and How They Work. . . . . . . . . . . . . . . . . . . . . . . . . . . page 2• Step 1: Setting up the Data Correctly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . page 5• Step 2: Creating a Database File That Connects to a File . . . . . . . . . . . . . . . . . page 6• Step 3: Creating a Mail Merge Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . page 8• Step 4: Printing Mail Merge Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . page 11

Page 2: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

2 Mail Merges

What Mail Merges Are and How They WorkOne of the main reasons you’ll create a database is to do mail merges. Here’s an overview of what they are and how they work.

What’s a Mail Merge?A mail merge is a system for letting you make one document and generate a personalize copy to everyone in a database. For instance, you can write your holiday letter and send a copy to everyone in your address book. Or you can send a copy of a letter requesting payment to everyone in your invoices database who hasn’t paid you yet.

Another example is that to make mailing labels, one for each of your customers.

Mail merge is a great way to do a lot of work without a lot of effort.

The Parts of a Mail MergeHere’s how it works.

Mail merge data – You have some data file: your list of customers, your address book, your huge database, whatever. It can be a plain text file, a spreadsheet, Microsoft Access, the OpenOffice.org Base database, or nearly anything else. The file can therefore have pretty much any extension: .txt for text files, .ods for spreadsheets, etc.

Mail merge database – You need to let OpenOffice.org know that you want it to be one of your databases for making mail merges. So you create a little database file, with the extension .odb, that holds the information about where the data is, that this is a special mail merge file, and so on.

Page 3: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

What Mail Merges Are and How They Work 3

Mail merge document – And of course you need a document, where the data from your data file shows up. You take this document, point it at the mail merge configuration file, decide which fields, or types of data, you want in the mail merge document: everybody’s first name, their address, their outstanding balance, their birthday, or whatever other data you have decided to put in that data file. Then you print, and you get a copy of that document for every person (or row) in that data file.

Output document – Once you print, you get the results, as labels, envelopes, or letters. You can print to the printer or to a file; when you print to a file you get a file containing a version of the mail merge document for every record you choose to print from the data.

What Data Is Made OfThe database can be made of nearly anything:

One or more text files, a spreadsheet, or an address book

A database file in Access, Oracle, mySQL, or another format

Just create the OpenOffice database middleman file, and point it at the data.

The exception to this two-part structure is when you create an OpenOffice database from scratch. The .odb database file doesn’t point to the data; it contains the data. You might need to make one of those, but most of the time you don’t. See the next section.

Why You Don’t Need a “Real” Database Most of the TimeOpenOffice lets you very simply put together all the mail merge functionality you need with a spreadsheet or other simple data store, a tiny database middleman file, and of course any mail merge document such as a letter or labels.

If you want to create queries of subsets of the data, or only print letters to certain subsets of the data, you can still do that with the data in the spreadsheet. You can use Data Pilot (pivot tables), re-sort the data, filter it, and do pretty much anything without creating a “true” database.

You get all, or pretty much everything, you need without much work at all. Put your data in a spreadsheet, make a database middleman file, and you’re almost always fine with just that.

Page 4: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

4 Mail Merges

Mail Merge DiagramHere’s a visual take on how it all works.

Fi rs tname Lastname Address Ci ty Sta te Z IPJohn Hanson 910 Harris Dr Kalispell MT 59901

Mary Jones 11 Main Street Bozeman MT 57788

Ellen Smith 1788 W 105th Boulder CO 80302

Dear John,

Thanks for your order this year. We hope things are going well in Kalispell. Be sure to let us know if we can do anything in the coming year!

Dear Mary,

Thanks for your order this year. We hope things are going well in Bozeman. Be sure to let us know if we can do anything in the coming year!

Dear Ellen,

Thanks for your order this year. We hope things are going well in Boulder. Be sure to let us know if we can do anything in the coming year!

Dear <Firstname>,

Thanks for your order this year. We hope things are going well in <City>. Be sure to let us know if we can do anything in the coming year!

Data in a text file, spreadsheet, Access database, or other format, such as namesandaddresses.ods.

OpenOffice.org .odb database file functions as the middleman. between the data and mail

merge documents.

Database file such as addressbook.odb.

Mail merge document in Writer connecting to the database file, with text, graphics, and fields from the database fie; sample name could be lettertoclients.odt..Output, to a Writer

file or to the printer, of the mail merge: one copy for each printed record of data.

Page 5: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

Step 1: Setting up the Data Correctly 5

Step 1: Setting up the Data CorrectlyYou probably have the data already, in some form. For this example, we’ll just take a look at spreadsheets and text files.

SpreadsheetsMake sure that the data is broken down into as small chunks as possible; first name and last name in separate columns, for instance. Also you must have a line of headings across the top of the spreadsheet, in the first row, as shown.

Text FilesYou can create a database from basic CSV, or tab-separated, text files. They must end in .csv or .txt, not other extensions, and like spreadsheets need to have headings like Firstname in the first line of the file.

Group the text files in their own directory. Each text file in a directory will be a separate table in the same database. All files must be of the same type; you can’t have some files that are comma-separated and some tab-separated. For instance:

Directory: textdata

Files: addresslist.txt, customerinfo.txt

Address BookGenerally this will just work. You’ll select address book as the type, and OpenOffice will find it. No prep necessary except normal cleanup, though if you want to remove addresses later, it will automatically be reflected in the database.

Page 6: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

6 Mail Merges

Step 2: Creating a Database File That Connects to a FileOne of the easiest things to do is enter your data in a spreadsheet, then connect to that when you create the database. You can also use a bunch of text files, or even your address book, as the data for the database.

In a spreadsheet, each sheet in the spreadsheet you point to becomes a table. Tables are what actually hold the data. With text files, each file in the directory you point to becomes a separate table.

1 Choose File > New > Database.

2 In the Database Wizard window, select Connect to an Existing Database.

3 From the list, you can select Text, Spreadsheet, or the type of Address Book you’re using; make the selection you want (except for LDAP address book). Or select another type of database if you’re using something more complex.

Address book

Spreadsheet

Text file

Page 7: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

Step 2: Creating a Database File That Connects to a File 7

4 Click Next.

5 Make the appropriate selections based on what you chose. Here are some tips.

Address book – The wizard will automatically find the address book so you don’t need to point to the address book file.

Spreadsheet – Specify the location of the spreadsheet. Then click Next.

Text file – Specify the location of the directory where your text files are. Each text file will become a separate table in your database. Then from the Field Separator list, select the correct separator and click Next.

6 In the last window, choose to register the database. You don’t have to open the database for editing unless you want to.

7 Click Finish.

8 When prompted, save the database. This is the .odb database file, separate from the data file itself. The name you choose here will show up in lists when you create mail merges.

To use the data in a mail merge, create a mail merge document.

Page 8: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

8 Mail Merges

Step 3: Creating a Mail Merge Document

Creating a Basic Mail Merge Document

Note – There is a far more complex, though slightly more powerful, mail merge wizard under the Tools menu. One additional feature that wizard has is the ability to automatically skip blank lines in addresses. For more information, see htttp://openoffice.blogs.com and click the link for Book Resources.

Follow these steps to create a mail merge letter from a new blank document or a template.

1 Create a new Writer document, or open the document or template that you want to use as a mail merge document. Add any content you want to add prior to adding fields.

2 Add fields using either of the following methods:

Use the Fields Window (better for shorter documents with only a few fields) Choose View > Data Sources. Select the database to use, click the + next to it, click the + next to tables (or queries if you’re printing from a query) and select the table itself. Then drag the field you want to use into the document.

Use the Fields Window (better for longer documents and more fields) Click in the document and choose Insert > Fields > Other. Click the Database tab, select Mail Merge Fields, select the database, then expand til you see the table and fields you want. Select the field you want, click in the document where you want it, and

Page 9: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

Step 3: Creating a Mail Merge Document 9

click Insert. Insert additional fields as needed, and close the field when you’re done.

3 Continue to insert other fields, and add any other content, formatting, graphics, etc.

4 Save the document.

Creating Mail Merge Envelopes and LabelsThis works like Simple Envelopes and Labels on page 241. Instead of typing the information in the main content area, however, you select the database, the table, and the fields.

1 Choose File > New > Labels.

2 From the Databases list, select your database; then select the table to use.

Page 10: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

10 Mail Merges

3 Select each field one by one, then use the arrow to insert the fields.

4 Click the Options tab and pick the printer to print to.

5 Then click New Document and you’ll see the mail merge document. You can cut and paste, format, and rearrange the fields in the document if it doesn’t look like what you want.

6 If you have more records in your database than can fit onto one label sheet, don’t worry—all the records will print. The label document you create is just kind of a template for the program. You’ll get all the labels that are in your database.

Previewing Data in a Mail Merge When you create a mail merge document, regardless of the type, you’ll see the field names, not the field data, since the field data is different for every copy you print. You can print to a file to preview everything, if you want, but if you want to preview just the first document of records (the first record, for a letter or envelope, or first page of labels, for a sheet of labels), follow these steps.

Select the name here that you specified when you saved the database.

Select the table here. This is the name of the sheet for spreadsheets, the text file for text files, or just the table for other database types.

Select the first field you want in the Databases Field list, and click the arrow. Add all other fields you want. Type any spaces, carriage returns, or other items you want.

Page 11: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

Step 4: Printing Mail Merge Documents 11

1 With the mail merge document open, choose View > Data Sources. In the area at the left, scroll to the data source you’re using. Select the database and the table or query you’re using as the basis of the mail merge document.

2 Click the blank gray square indicated in the data area of the preview window to select all records. Then click the indicated Data to Fields icon.

3 The letter will show data from the first record instead of field names.

Step 4: Printing Mail Merge DocumentsPrinting isn’t too complicated; you just have a few extra options that you don’t have with regular printing.

Basic Mail Merge Printing1 Open any of the mail merge envelopes, labels, or letters you’ve created previously.

2 Choose File > Print.

3 You’ll be asked whether you want to print a form letter. Click Yes.

4 In the Mail Merge printing window, you have a variety of options. The following illustration highlights some; the subsequent procedures go over them in more detail. Select the range of data to print by clicking and holding down Shift or Ctrl to select more records; choose to print to the printer or to a file (I recommend printing to a Writer file first), and whether to print to one single file or an individual file for each record (I recommend one single file).

Page 12: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

12 Mail Merges

You can also sort and filter the data and thus print letters only for the records you want to print, in the order you want.

5 Click OK.

6 If you’re printing to a printer, select the printer and click OK. If you’re printing to a file, name the file; a normal Writer file with output from the selected records will be created.

Click to see the Sort window, or justselect a column and click the A>Z or

Z>A sort icons.

Select a single cell and click AutoFlter to see all records with that value for that column.

Click Standard Filter to use the tools described in Creating a Standard Filter on page 456.

Click on the gray box to the left of a record, then hold down Shift to select consecutive records or Ctrl to select non-consecutive records.Print to the printer or a file; a plain Writer file will be created with a copy of the document (or of each label) for every selected record.

If you want a separate Writer file for every selected record, select Save as Individual Documents. Otherwise (preferred) select Save as Single Document.

Select a range; if you select certain records, Selected Records will be on by default.

Page 13: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

Step 4: Printing Mail Merge Documents 13

7 If you printed to a file, open it to check it, then print it normally to a printer. The following example shows the output from the top of three pages.

Restricting, Sorting, and Filtering Mail Merge PrintingYou’ll typically find you don’t usually want to print all the records from a particular table in your mail merge. Here’s how to control what’s printed.

Setting Up Data to Enable Sorting and FilteringYou might not want to print a letter for all records in the database, all the time. For instance, if you’re a teacher you might need to send a specific letter only to parents of children with failing grades, or only to girls if the subject involves Girl Scouts.

You need to be sure, when you’re setting up your spreadsheet or other data, that you have a field that is used to track the way you want to group the records. If you want to be able to send letters only to girls to sort by whether someone is a girl or a boy, be sure to have a Gender column (field), even if you never need to have display the field in a letter. If you want to be able to send letters only to customers in good standing or with whom you have only had successful projects, then you need a column called Paid_Up or All_Successful and have Yes or No values for each field, for each row.

Printing a Specific Range of RecordsSelect the records by clicking on the gray square next to each record. Hold down Ctrl and select the records to print. Hold down Shift to select consecutive records like 9-20.

Page 14: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

14 Mail Merges

Printing Records in Order Using SortQuick sorting In the print window, click on any column such as City or Last Name, then the A-Z or Z-A icon, to sort by that column..

Standard Sort In the print window, click the Standard Sort icon. See Sorting Using the Sort Window on page 451 for more information on sorting using this window.

Page 15: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

Step 4: Printing Mail Merge Documents 15

Printing Specific Records Using FilterUsing AutoFilter In the print window, click on a single cell, such as the value of the state CT in the State column. Then click the AutoFilter icon; the results will be only records that have that same value in that column.

Using the Standard Filter In theThe Filter window allows you to choose which data to print. For more information, see Creating a Standard Filter on page 456. From the first list select a field such as Last Name or State; select Like for equals (or Not Like for not equals); then type a value.

To add additionalcriteria, select the field

name first; then the ANDor OR option will be

available.

Page 16: Mail Merges - OpenOffice.org Training, Tips, and Ideas · Mail merge database – You need to let OpenOffi ce.org know that you want it to be one of your databases for making mail

16 Mail Merges

Removing a Filter or SortClick the Remove Filter/Sort icon.