https://bugs.documentfoundation.org/show_bug.cgi?id=102010
--- Comment #4 from Alex Kempshall <[email protected]> ---
I'm seeing this problem in 5.2.2.2 and in 5.3.0.0.alpha0+ Master, when running
a basic macro in Base which is expected to produce a merged file from a dataset
pulled from MariaDB.
What I get is a file called CompanyMerged when I'm expecting a file called
CompanyMerged0.odt
This problem wasn't present in 5.1.5.2 when I get the expected file
CompanyMerged0.odt
I've also replicated the problem using a macro in Writer using the following
code. In this code I've changed the FileNamePrefix so the file won't get
overwritten each time.
Dim oMailMerge as Object
Dim DirectoryName as String
DirectoryName = DirectoryNameoutofPath(ThisComponent.getURL(), "/") & "/"
If (Not GlobalScope.BasicLibraries.isLibraryLoaded("Tools")) Then
GlobalScope.BasicLibraries.LoadLibrary("Tools")
End If
oMailMerge = CreateUnoService("com.sun.star.text.MailMerge")
oMailMerge.DataSourceName = "CompanySeed"
oMailMerge.DocumentURL = ConvertToUrl(DirectoryName &
"CompanySeed.odt")
oMailMerge.CommandType = 0
oMailMerge.Command = "CompanySeed"
oMailMerge.OutputType = com.sun.star.text.MailMergeType.FILE
oMailMerge.OutputUrl = ConvertToUrl(DirectoryName)
oMailMerge.FileNamePrefix = "Merged-" & Format(Now, "yyyymmddHHMMSS")
& "-"
oMailMerge.SaveAsSingleFile=True
oMailMerge.FileNameFromColumn=False
oMailMerge.Filter=""
oMailMerge.execute(Array())
oMailMerge.dispose()
The above code needs the data and the starting file setting up first. I'm
finding it easier to create these using the Mail Merge Wizard.
Alex
--
You are receiving this mail because:
You are the assignee for the bug._______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs