Bug 94987 - RFE: MAILMERGE: set the destination path from a variable
Summary: RFE: MAILMERGE: set the destination path from a variable
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
Whiteboard: target:5.3.0
Depends on:
Blocks: Mail-Merge
  Show dependency treegraph
Reported: 2015-10-12 18:07 UTC by Marina Latini (SUSE)
Modified: 2017-07-14 16:05 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Marina Latini (SUSE) 2015-10-12 18:07:35 UTC
As in bug 36075, it would be nice select the path from a variable. This request isn't a duplicate because here we are talking about path ;)

Details of the feature:

First case: the user selects a path without specifying a variable to be used as subfolder name. 
In this case mail merge works as usual :)

Second case: the user selects a path specifying a variable to be used as subfolder name. 
When the user selects a path, the mail merge feature creates one subfolder for each record involved.

I know that this feature, potentially, can create a lot of subfolders but, without this feature, the user must create the subfolders and move the files on it manually.
Comment 1 Cor Nouws 2015-10-12 21:17:31 UTC
I like the idea, Marina. Thanks!
Comment 2 Jan-Marek Glogowski 2016-08-26 20:09:35 UTC
From my point of view this feature (almost?) already exists, and it's the same solution then for bug 36075, especially since the other report states he already uses a Calc file as mail merge input. At least my proposal is already a workaround for bug 36075.

You can set the merged document name from a DB column. At least that option is available, if you mail merge a document via "Ctrl + P". I didn't check the mail merge wizard.

The file name is constructed by concatenating:

1. a path, selectable by the user. If it doesn't end with a slash, it's last component is considered as the start of the file name.
2. the column data (which can contain a slash - internally LO uses URIs!) or the original file name
3. an increasing number, if a file with the same name already exists
4. the filetype extension

What is (quite probably) currently missing is the creation of the subdirectories, as the current temp file code expect the path to exists, where it tries to create the file (but I didn't check).

If your input DB is actually a Calc sheet, you should be able to construct the name in any way you want using any Calc formulars.

We probably just need a better documentation for this feature of mail merge and probably some better UI.

Any additional comments welcome.
Comment 3 Commit Notification 2016-09-23 21:29:49 UTC
Jan-Marek Glogowski committed a patch related to this issue.
It has been pushed to "master":


tdf#94987 Create directories for temp filenames

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:

Affected users are encouraged to test the fix and report feedback.
Comment 4 Xisco Faulí 2017-07-14 13:22:43 UTC
Polite ping: is this bug fixed? if so, please close it as RESOLVED FIXED
Comment 5 Jan-Marek Glogowski 2017-07-14 16:05:58 UTC
I was waiting for a comment on the implemented feature, as it has a different workflow the suggested. IMHO it's the same use case, but a different implementation and realization.

Since there were no comments since quite some time, I close it as fixed.