outputstream
Tom Schindl
Christian Junker
How can I write to outputstream
Dim content = "Hello World!"
fileAccessService = createUnoService("com.sun.star.ucb.SimpleFileAccess")
textOutputStream = createUnoService("com.sun.star.io.TextOutputStream")
If fileAccessService.exists(SaveFileName) Then
If fileAccessService.isReadOnly(SaveFileName) Then
MsgBox "Could not write to file: " & SaveFileName
Exit Function
End If
End If
'now open the file..
outputStream = fileAccessService.openFileWrite(SaveFileName)
outputStream.truncate()
textOutputStream.setOutputStream(outputStream)
textOutputStream.writeString(content)
'Close the Xml File, no writing possible anymore
textOutputStream.closeOutput()
'msgbox "xml saved under: " & SaveFilename
Initial version