Code: Select all
Sub ExportToGlossary
Dim oDoc as Object
Dim glossaryFileProperties(3) as new com.sun.star.beans.PropertyValue
Dim sURL as String
oDoc = ThisComponent
If oDoc.getLocation() = "" Then Exit Sub
sURL = "file:///E:/export_to_glossary.txt"
glossaryFileProperties(0).Name = "FilterName" ' setting properties of exported file such as tab as field delimiter, nothing as text delimiter, UTF-8 as encoding
glossaryFileProperties(0).Value = "scalc: Text - txt - csv (StarCalc)"
glossaryFileProperties(1).Name = "FilterOptions"
glossaryFileProperties(1).Value = "9,0,76,1,,0,false,true,false"
glossaryFileProperties(2).Name = "Overwrite"
glossaryFileProperties(2).Value = True
oDoc.storeAsURL(sURL, glossaryFileProperties())
End Sub
Code: Select all
BASIC runtime error.
An exception occurred
Type: com.sun.star.task.ErrorCodeIOException
Message:.
(Damn those programmers that don’t bother about producing clear error messages!)
LibreOffice 5.0.0.4 is somewhat more eloquent:
Code: Select all
BASIC runtime error.
An exception occurred
Type: com.sun.star.task.ErrorCodeIOException
Message: SfxBaseModel::impl_store <fiIe:///E:/expоrt_to_glоssary.txt> failed: 0x81a.
Code: Select all
Dim mFileProperties(0) As New com.sun.star.beans.PropertyValue
Dim sUrl As String
sUrl = "file:///complete/path/To/New/document"
mFileProperties(0).Name = "Overwrite"
mFileProperties(0).Value = FALSE
oDocument.storeAsURL(sUrl, mFileProperties())
Can anyone give me a pointer what should I look at?
P. S. I have full read/write permissions on the partition concerned.