Documentation/WollMux/Mail Merge/Merging source document and data source

    From The Document Foundation Wiki
    Other languages:

    Merge source document and data source

    Preview

    To check if the result will meet your expectations before merging the source document and data source, you can display a preview.

    Show preview

    Click on the Preview button in the sidebar. You will then see the content of the first record instead of the names of the mail merge fields. It will also be displayed as a number a little further to the right.

    The button is now called <fieldname>

    Turn off preview

    Click on the button <fieldname> in the sidebar. You will then see the names of the mail merge fields again instead of the contents of the records.

    The button is now called Preview again.

    Print mail merge

    To print the mail merge, click the Print button in the sidebar. Now the mail merge dialog of WollMux appears, which offers you a number of options.

    Print dialog of WollMux
    Print dialog of WollMux

    Via the function Use the following records the number of printouts can be limited.

    Create complete document (.odt)

    This option is the default option when you start the mail merge dialog.

    With this selection, the mail merge with all records will be written to a single document, which will then contain all records.

    Create complete document (.pdf)

    Similar to Create complete document (.odt) a single document with all records will be generated. But since it is a PDF, a subsequent adjustment like with Create complete document (.odt) is not possible.

    Print directly

    The form letter can also be printed directly. The usual printer options can be set. For this the Next > button must be pressed. If one selects directly Finish, then on the preset printer is printed.

    → Supports "Next record" function

    Print directly
    Print directly

    Send e-mails

    Hereby the serial letters can be sent directly as email(s). To do this, please proceed as follows:

    • Specify a pattern for the attachment name. Mail merge fields can be used for this (compare Create single files.
    • As sender please replace <felix.wollmux@muenchen.de> with your email address.
    • The data source needs a column containing the email addresses of the recipients.
    • You can specify the subject and the content of the message using the appropriate fields. You can also use mail merge or special fields for this purpose.
    Mail merge as email
    Mail merge as email


    Create single files

    With this option the mail merge letters are written into single files. The following options are available:

    • .odt and .pdf are available as output format.
    • You can specify a pattern for the file names. You can also use mail merge and special fields for this purpose.
    • You can select any destination directory where the files will be saved.

    You can use the Use the following records function to limit the number of individual files.

    Create single files
    Create single files


    Start mail merge

    You start all types of mail merge with the button Let's go. A progress bar informs you about the progress of the print. Larger documents - i.e. with many records will take a little longer. Large mail merges of about 300 up to about 8000 records work best with the pdf total print.

    Progressbar
    Progressbar

    Print blank pages in mail merge documents

    In LibreOffice, there is an option Automatically print inserted blank pages. under Tools → Options → LibreOffice Writer → Print. This option is disabled by default for technical reasons. However, there is one constellation where you need to enable this setting. The following table illustrates the different options and the required settings:

    Printer

    Page number

    Print automatically inserted blank pages

    Duplex

    Even

    disabled

    Duplex

    Odd

    enabled

    Simple (without duplex)

    Even

    disabled

    Simple (without duplex)

    Odd

    disabled

    So you need to enable the option Automatically print inserted blank pages if you use a duplex printer and have a mail merge letter that has an odd number of pages. After printing, you should disable the option again.

    If you don't always want to do this, you can insert a blank page at the end of mail merge letters with an odd number of pages so that you have an even number of pages, then you don't have to worry about the Print automatically inserted blank pages option.

    Use Ctrl + Enter to insert a manual page break at the end of your form letter, and thus a blank page.

    Blank pages in the overall PDF document

    If you want to create an overall document PDF with blank pages, another option must be set. This can be found under File → Export as → Export as PDF... → Export automatically inserted blank pages. Unfortunately, it is still necessary to start the export once so that the setting is saved and can be used in mail merge. The exported PDF document does not need to be saved. Now you can do the mail merge as usual as a whole document PDF and get a blank page after each record if you have an odd number of pages.

    After printing you should deactivate the option again.

    Filter records for printout

    If you want to use only a selection of your records for your mail merge, you can easily do this with the filter options in LibreOffice Calc. In principle, there are two different ways to do this, but they are only briefly introduced here.

    Hide rows

    By simply hiding single rows, you filter them out for the mail merge. If it should not become too complex, this option offers only few possibilities. It is suitable for filtering out e.g. record (line) 25 - end. Then only the first 24 (if row1 contains the heading) records are used for the mail merge.

    To hide rows in Calc, select the rows by row number and choose Hide from the context menu (right click).

    Filter in Calc

    To narrow down your data you can use the filtering options of Calc. The most comfortable solution is probably the autofilter. You can set the autofilter in Calc via Data → Filter → Autofilter. You can recognize the activated autofilter by the boxes with ▼

    Example of an autofilter
    Example of an autofilter

    The autofilter allows you to select specific criteria in each column by which you can narrow your data.

    Likewise, you can of course apply filters to multiple columns at once to further restrict your data, for example, you could filter the Salutation column by "Mr." and the City column by "Munich" so that the only records left as a result are those that are about gentlemen who live in Munich.

    Using an already existing source template (or document)

    If you have saved your source template, you can call it up again at any time and perform the merge again.

    When opening the source template, the mail merge sidebar is not automatically activated.

    Call it up as usual via Tools → Mail merge (WollMux).

    The location of the data source is stored in the source template, so after calling it, the data source is connected as in the last merge. The prerequisite for this is that the file has not been moved or renamed.

    If you now want to use another data source with the source template, click on Data source and select the desired data source.