[Issue][Writer] Mailmerge can't save to Win Lib directories

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Bidouille
Volunteer
Posts: 574
Joined: Mon Nov 19, 2007 10:58 am
Location: France

[Issue][Writer] Mailmerge can't save to Win Lib directories

Post by Bidouille »

Hi all,
Steps to reproduce:
1) Create a new document
2) With F4 datasource, drag and drop some Bibliography fields
3) Save your document
4) Execute this code:

Code: Select all

Sub MergeMe
    sSource = "Bibliography"
    sTable = "biblio"
    sPrefix = "Identifier"
    sDoc = ThisComponent.URL
rem    sOut = ConvertToURL( Environ("USERPROFILE") & "\Documents")
    sOut = ConvertToURL( Environ("PUBLIC"))

    oMM = createUnoService("com.sun.star.text.MailMerge")
    With oMM
        .DataSourceName = sSource
        .CommandType = com.sun.star.sdb.CommandType.TABLE
        .Command = sTable
        .OutputType = com.sun.star.text.MailMergeType.FILE
        .FileNameFromColumn = True
        .FilenamePrefix = sPrefix
        .SaveAsSingleFile = True
        .DocumentURL = sDoc
        .OutputURL = sOut
        .execute(Array())
        .dispose()
    End With
End Sub
oups.png
oups.png (7.17 KiB) Viewed 2443 times
Unable to save into Public directory: read-only error
Same thing with Libraries subdirectories: Documents, Pictures, etc

Seems to be buggy since Windows 7 and later

Before filing an issue, I would like to know if you can reproduce.
Last edited by Bidouille on Mon Jul 17, 2017 11:55 am, edited 1 time in total.
UnklDonald418
Volunteer
Posts: 1544
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: [Writer] Mailmerge can't save to Win Lib directories

Post by UnklDonald418 »

I can confirm that the code fails on my Windows 10 system just as you described.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Bidouille
Volunteer
Posts: 574
Joined: Mon Nov 19, 2007 10:58 am
Location: France

Re: [Writer] Mailmerge can't save to Win Lib directories

Post by Bidouille »

Thanks for this feedback
Open an issue: https://bz.apache.org/ooo/show_bug.cgi?id=127421
Post Reply