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

Keyboard macros or custom scripts

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

Postby Bidouille » Fri May 19, 2017 3:51 pm

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   Expand viewCollapse view
Sub MergeMe
= "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
    End With
End Sub

oups.png (7.17 KiB) Viewed 83 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.
User avatar
Posts: 191
Joined: Mon Nov 19, 2007 10:58 am
Location: France

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

Postby UnklDonald418 » Sat May 20, 2017 5:47 am

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 subject line
Apache OpenOffice 4.1.3 - Windows 10 Professional
Posts: 452
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Return to OpenOffice Basic, Python, BeanShell, JavaScript

Who is online

Users browsing this forum: No registered users and 6 guests