mail merge with variable images

I am looking for a way to create a mail merge with variable images. The filename of the picture is part of the Calc table from which all fields come. In Microsoft Word there is a command {INCLUDEPICTURE } for this. Is there something comparable in LO?

Please give us more information about what you would like to achieve. Thank you. To do this please read:

This is the guide - How to use the Ask site? - #3 by Hrbrgr

This is the guide - How to use the Ask site? - #3 by Hrbrgr

I have an sheet with a text and a file name of an image in each row and want to create a writer document with a text and an image on each page. In Microsoft Word there is a macro {INCLUDEPICTURE “filename”}, where filename can be a mail merge variable. Is there something similar in Writer or have I to buy Word?

Note: the final product is a printed book. That is the reason why reports may not sufficient to solve the probleme.The output is subject to a final editing step.

I don’t understand your problem. If the Writer document is supposed to be a replica of the Calc sheet (except for the image display), why didn’t you go with Writer from the beginning. I assume that your “text” is the one coming from the spreadsheet. This means it can be rendered “monolithically” , i.e. formatting is uniform across it, which could not be what you desire.

The fact that you request a page-formatting structure suggests that Writer may not be the proper tool (but mail-merge may fix this thanks to a side-effect) because Writer is flow-oriented. A DTP (desktop publishing) application like free Scribus could be better fit for the task because DTP programs are page-oriented.

Please give more details about your text and the purpose of the document. Also, what is the target size of the image?

I need a Writer mail merge document, which generates one page for each line in the calc sheet, which contains a text and an image, which file name is also in the sheet.

In short, I just need a way to include images by mail merge in Writer.

Word has a Macro to insert an Image by a file name variable. Is there something like that in LO?

I assume the Writers formatting features are sufficient. I read a forum post that suggested to solved that by database reports. But the output (!) must be editable.

No images in merge fields. You get a similar result from a database report.
Download and extract PicsDB
There is a spreadsheet with some names of picture files and database BasePics_Calc.odb connected to that spreadsheet.
Open BasePics_Calc.odb, notice the connection indicated in the statusbar, go to the reports section and open the report.

The other 2 database documents are the same but they store the text data in a true database instead of a spreadsheet. BasePics_FB.odb contains a Firebird database. BasePics_HSQL.odb contains a HSQL database. You can view and edit the table data using the embedded input form.

You keep repeating the same request in your 3 posts with hardly a change in words. You gave absolutely no information on your configuration (OS name, LO version and save format) as pointed to by @Hrbrgr. We know you already have listed your picture filenames in a spreadsheet but you still refuse to describe what is in the text (length, purpose, how it is supposed to be “embellished” by Writer", …), how many lines/pictures you have, the average size of these pictures, … In short, any information useful to simplify the problem and hint at a solution other than redo everything manually in Writer.

Since this is a benevolent volunteer-to-user site which has no commercial or other commitment to solve problems within some time-frame, consider this is my last attempt to help you. I also have my own business to care about.

I can simplify the question once more. Ignore the text and formatting complete.

The output should be a 200 page writer file, each page contains only one image which name is listed in the calc sheet. There is nothing else on the pages.

The output must be in the odt or doc format.

Can the database reports output odt or doc files? I have top be able to edit the output manually.

File>Save As … (odt, pdf, doc, docx, html, …)

@eaglesky wrote the same question in the German LO forum on 29 June 2023: Serienbrief mit variablen Bildern
In the answers @Villeroy’s proposal is included (double the work for helpers, sigh). There are some additional proposals ending in the advice to better use Scribus for this project.

See also @Berteh’s annotations in Bugzilla!

1 Like