Documentation/How Tos/Creating Mail Merge Documents From Text/CSV or Spreadsheets
From Apache OpenOffice Wiki
Template:Documentation/BeingEdited
This is all you need to do to make a nice simple document based on data in text files or spreadsheets.
Contents
Get Your Data
You probably already have it. It is in a .txt file or .csv that is comma or tab separated, perhaps. Or it is just a spreadsheet.
Make the Data Source: Text File Instructions
If your data is in text files, follow these steps.
- Choose File > New > Database.
- Select Connect to an existing database, with Text as the format.
- Click Next.
- Specify the directory where the text files are. Each text file in that directory will be a table in your database. Then select the item separating fields, i.e. a tab or comma or something else.
- When all the settings look correct, click Next.
- Unmark the option to open the database for editing. You can open it; you just do not have to.
- Click Finish.
- Save the data source (aka database) under a name that will help you remember what it is.
Make the Data Source: Spreadsheet Instructions
If your data is in a spreadsheet, follow these steps.
- Choose File > New > Database.
- Select Connect to an existing database, with Spreadsheet as the format.
- Click Next.
- Specify the spreadsheet file. Each sheet in that spreadsheet will be a table in your database.
- Click Next.
- Unmark the option to open the database for editing. You can open it; you just do not have to.
- Click Finish.
- Save the data source (aka database) under a name that will help you remember what it is.
Create Your Mail Merge Document and Suck the Data In From the Datasource
- Create a new Writer document or open a document containing text that you want in the mail merge document.
- Choose View > Data Sources. Everything you have created will be displayed. Click the + sign by the data source you want to use, then click + by Tables until you see the data you want to use.
- Type any content you want and do any formatting. You can do this later too.
- Click on the NAME OF THE FIELD, not the piece of data, that you want in the mail merge.
- Drag it into the document and release. The field name will appear.
- Add any other content and fields you want.
- Save the document. You are ready to print.
Print the Mail Merge Document
- Choose File > Print.
- You will see a message asking you whether you want to print a form letter. Click Yes.
- In the print window, specify the range of records, if you do not want them all, and specify to print to a printer, or to files.
- Click OK.
- In the print window, specify the printer and click Print.