Hi,

I' trying with the code below, but the result is always negative, the
contents of the written file is still in zipped form. Without using a
stream as storage but a file as normally done it works, the whole bunch
is written out as text (content.xml, ...).

If I use a "FilterName" it results in a css.io.IOException with the
message ".".

What's happening here? Is it technically impossible to write unpacked to
a file stream or am I missing something?

<snip>
sub docToStreamTest

        tmpDoc = thisComponent
        
        SaveFileName = convertToUrl("/home/marc/textdoc.str")
        fileAccessService = 
createUnoService("com.sun.star.ucb.SimpleFileAccess")

        If fileAccessService.exists(SaveFileName) Then
                If fileAccessService.isReadOnly(SaveFileName) Then
                        MsgBox "Could not write to file: " & SaveFileName
                        Exit sub
                End If
        End If
        outputStream = fileAccessService.openFileWrite(SaveFileName)            

        dim Args(3) as new com.sun.star.beans.PropertyValue
        'args(3).Name = "FilterName"
        'args(3).Value = "OpenOffice.org 1.0 Text Document"
        'args(3).Value = "FlachML Writer"
        
        args(2).Name = "Overwrite"
        args(2).Value = TRUE
        Args(1).Name = "Unpacked"
        Args(1).Value = TRUE
        Args(0).Name = "OutputStream"
        Args(0).Value = outputStream
        tmpDoc.storeToUrl("private:stream", Args())

        outputStream.closeOutput()
        
end sub
</snip>

TIA,
Marc



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to