Page 1 of 1

Mail merge with LibreOffice Writer - Solved

Posted: Thu May 18, 2023 11:28 pm
by Topher
I need to merge some information into a letter. I saw how to add names and addresses to the letter, pretty easy. But each person has three pieces of information that are particular to them and that needs to be included in the main body of the letter. I did not see anything about adding information like that. Is it possible with writer? It seems like it should be.

Re: Mail merge with LibreOffice Writer

Posted: Thu May 18, 2023 11:36 pm
by CharlesV
Yes any data can be brought in using mail merge.

Here is a good tutorial on it
https://books.libreoffice.org/en/WG71/W ... Merge.html

Re: Mail merge with LibreOffice Writer

Posted: Fri May 19, 2023 12:15 am
by Topher
That is what I saw and used. But it only showed names, addresses, title, gender - all information that would be used in the start of a letter and meant to be part of a heading or address block. There was nothing about being able to add information into the main body of a letter. If that is all you can do with mail merge in writer, then I can't use it. I have used glables and can add information anywhere. But for a letter that would be a very very very long string. It could be done but I thought maybe writer could handle it better. But I guess not.

Re: Mail merge with LibreOffice Writer

Posted: Fri May 19, 2023 12:34 am
by CharlesV
It has been a while since I did it, but it was able to do ANY data, it all depends upon your data source. It is NOT limited to what is shown there.

Once you have connected your data, then its just a matter of specifying the field in the data.

Re: Mail merge with LibreOffice Writer

Posted: Fri May 19, 2023 12:44 am
by CharlesV
Here is a different link. it shows how to use a different database and tag / merge any data.

https://www.bettertechtips.com/office/m ... ce-writer/

and here is a quick shot of doing this using software and version, dragging the fields down into the merge letter.

Re: Mail merge with LibreOffice Writer

Posted: Fri May 19, 2023 4:26 am
by Eadwine Rose
My dad has to do this a few hundred times with organization members. He uses excel for the address data where all the members are stored, miss mrs sir last name etc, then uses a macro to call the corresponding fields into word in order.

I wager something like that could be possible in LibreOffice.

That is about the extent of my knowledge ;)

Re: Mail merge with LibreOffice Writer

Posted: Fri May 19, 2023 9:39 am
by Topher
I don't think we are on the same page. Let's say I want to send out party invitations to my special group and I have a spreadsheet with their names and addresses and their special dishes that each is known for. Their names and addresses go in just fine. But in the body of the letter where I give the date of the party, the time of the party and where it is to be held which is all the same for everyone. But in the body I also ask each one, by first name, to bring their own dish, which I have in the spreadsheet. For example: Please Carol bring your potato salad, Please Steve bring your crab dip, etc. This is where I don't see how to enter the information and that doesn't seem to be covered by mail merge in writer. Unless I am missing something. Just creating a form letter to be sent out to dozens of people is a piece of cake. But I don't see how to be able to put individual information into the body.

Re: Mail merge with LibreOffice Writer

Posted: Fri May 19, 2023 9:41 am
by Eadwine Rose
That is where my dad gets the info from a spreadsheet using a macro. It calls for cell 1 in spot a, cell 2 in spot b, etc.

I have no experience with macros, but that is how he does what you describe.

Re: Mail merge with LibreOffice Writer

Posted: Fri May 19, 2023 10:50 am
by CharlesV
As I recall there are four or 5 "user x" fields somewhere in that process that you can grab and use. ( user1, user2, etc) When I used to send out software update notices I had an ods with all the mailing info, plus the client first name, software name, the version they were on and then the new version that was available.

The software data was all down in the letter body and picked up out of the ods and merged.

When I went to emailing information years ago, I moved to an entirely different system. I am not sure I can do it today, but I will hunt for that older mail merge I used to use and see how it was done.

Re: Mail merge with LibreOffice Writer

Posted: Fri May 19, 2023 6:04 pm
by CharlesV
@Topher I cannot find my original files (been years!), but I just created one with the steps I remember and the latest Libreoffice.

The steps are attached. Hope this gets done what your after.

Re: Mail merge with LibreOffice Writer

Posted: Fri May 19, 2023 8:15 pm
by Topher
That should help. I'll try it tonight. Thank you

Re: Mail merge with LibreOffice Writer

Posted: Mon May 22, 2023 11:24 pm
by Topher
I tried different ways to make this work for me, but ran into some issues.
1. I didn't see any way to change the size of the name & address space, though after thinking about it, I can probably place it so the white space is on the top and the address is on the bottom of the outline. And there wouldn't be such a large clunky looking gap between the address and the body of the letter.
2. When I added numbers to the letter, the thousands separator did not show up, just the number.
3. I tried to skip the name & address block and just add the data into the body of the letter. I could choose the spreadsheet, but the spreadsheet data did not show at all, it just showed a white space where the data should be.

Re: Mail merge with LibreOffice Writer

Posted: Tue May 23, 2023 12:25 am
by CharlesV
Topher wrote: Mon May 22, 2023 11:24 pm I tried different ways to make this work for me, but ran into some issues.
1. I didn't see any way to change the size of the name & address space, though after thinking about it, I can probably place it so the white space is on the top and the address is on the bottom of the outline. And there wouldn't be such a large clunky looking gap between the address and the body of the letter.
2. When I added numbers to the letter, the thousands separator did not show up, just the number.
3. I tried to skip the name & address block and just add the data into the body of the letter. I could choose the spreadsheet, but the spreadsheet data did not show at all, it just showed a white space where the data should be.
Can you show some pix of your letter, with fields for the data in the spreadsheet?
( you can PM me if you dont want to show it in forum )

Attached is a zip file with 3 files in it. The Mail merge main file, the ods data and then the resulting output file. If you open Wirter_Mail_Merge_Example.odt and make sure the Mail Merge Toolbar is open and then click on the Data Sources, you should see the table, and clicking on the merge arrows should show the data in the letter.

The output_file.odt file is the result of clicking on the Save merged documents button and choosing to Save as a single file.

I will look at number formatting in a merge.

Re: Mail merge with LibreOffice Writer

Posted: Tue May 23, 2023 12:47 am
by CharlesV
Topher wrote: Mon May 22, 2023 11:24 pm
2. When I added numbers to the letter, the thousands separator did not show up, just the number.
In order to format a number field you have to:
1) Make sure the field in the ods is numeric, and then
2) Change the formatting in the document .
- Right click on the number field in your letter, and click on edit Fields
- Change the Radio Button on Format. Select User Defined, change the format to the format you want and then click Ok

Re: Mail merge with LibreOffice Writer

Posted: Tue May 23, 2023 11:01 am
by Topher
I didn't know it was possible to edit a field. I can use mail merge now for some things that I used glabels for.
It would be nice if I could use it without the name address block it seems to want to insist on being there. Just skip that part and add data into the body of the letter.
Thank you for your help. I really appreciate it. :popcorn: :popcorn:

Re: Mail merge with LibreOffice Writer

Posted: Tue May 23, 2023 11:16 am
by CharlesV
Topher wrote: Tue May 23, 2023 11:01 am I didn't know it was possible to edit a field. I can use mail merge now for some things that I used glabels for.
It would be nice if I could use it without the name address block it seems to want to insist on being there. Just skip that part and add data into the body of the letter.
Thank you for your help. I really appreciate it. :popcorn: :popcorn:
Your very welcome. And no, you do not have to use that address block, you can just use straight from the data and in any location in the letter that you want. ( You just cant use the mail merge wizard... it has to be done "manually" )

Re: Mail merge with LibreOffice Writer

Posted: Tue May 23, 2023 7:48 pm
by Topher
And no, you do not have to use that address block, you can just use straight from the data and in any location in the letter that you want. ( You just cant use the mail merge wizard... it has to be done "manually" )
OK, I'll bite. How do you do it manually? I assume you don't mean to enter the information into each letter manually, but there is a way to do it automagically.

Re: Mail merge with LibreOffice Writer

Posted: Tue May 23, 2023 8:09 pm
by CharlesV
Topher wrote: Tue May 23, 2023 7:48 pm
And no, you do not have to use that address block, you can just use straight from the data and in any location in the letter that you want. ( You just cant use the mail merge wizard... it has to be done "manually" )
OK, I'll bite. How do you do it manually? I assume you don't mean to enter the information into each letter manually, but there is a way to do it automagically.
No, there are two methods to doing mail merge in libre. 1) the wizard - which appears to attempt to do an address block. and then 2) Using the Mail Merge buttons on that Mail Merge toolbar.

Using method 2, you can pull in fields from your ods, never using the address block, and then once you have "manually built" the document (ie adding your fields from the ods), then click one of the buttons on the toolbar. (ie Save Merged Documents, Print Merged Documents, or Send Email Messages.)

That is all in that document I linked / attached and it works via method #2 . ("manually" )

Re: Mail merge with LibreOffice Writer

Posted: Wed May 24, 2023 10:56 pm
by Topher
I have tried method2 before as it seemed to me that if I could skip the Mail Merge part wanting the name & address block and go right into choosing fields from the spreadsheet then I would be golden. But even though the spreadsheet file I wanted was listed, it would never show the spreadsheet unless I started with Mail Merge. That is why I thought that you had to start with Mail Merge.
If I right click on the spreadsheet, it brings up two choices: Edit Database File - which does nothing and Registered Databases. Clicking on Registered Databases - brings up a popup showing the Bibliography File showing where it is located. And my file that shows: vnd.sun.star.pkg://file:%2F%2F%2home2 - I can't see the rest of the string and can't copy it either. But if I click on EDIT then I can see the whole string and location. And lo and behold it is pointing to the document that I am in, not the spreadsheet, so no wonder there is nothing showing up on the right. So I click on browse to point to the spreadsheet file, but it is only looking for ODF database files and I can't point to the spreadsheet.
Maybe I need to start over but I still would have the problem of pointing to a spreadsheet. Is there something I need to do the register the spreadsheet?

Re: Mail merge with LibreOffice Writer

Posted: Thu May 25, 2023 12:59 am
by CharlesV
You have to connect your data ( Edit | Exchange Database ) and then add the spreadsheet.

Full instructions are in that document I attached.

Re: Mail merge with LibreOffice Writer - Solved

Posted: Thu May 25, 2023 9:38 am
by Topher
I feel really dumb as I was always the one to ask if they followed the instructions the way I told them to. I'll blame my old age for not following my own advice :bagoverhead:
It works great.

Re: Mail merge with LibreOffice Writer - Solved

Posted: Thu May 25, 2023 12:04 pm
by CharlesV
No worries, Glad you got it :-)