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
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.