Hi Marc, yes that is possible.

I will give you some code that will show you how to deal with xml
outputstreams (it's actually pretty similiar to Java's API):
<snip>
 fileAccessService = createUnoService("com.sun.star.ucb.SimpleFileAccess")
 textOutputStream = createUnoService("com.sun.star.io.TextOutputStream")

 If fileAccessService.exists(SaveFileName) Then
        If fileAccessService.isReadOnly(SaveFileName) Then
                IOStreamXML = -2
                Exit Function
        End If
 End If
 'now open the file..
 outputStream = fileAccessService.openFileWrite(SaveFileName)           

 outputStream.truncate()
 textOutputStream.setOutputStream(outputStream)
 textOutputStream.writeString(xmlcontent)

 'Close the Xml File, no writing possible anymore
 textOutputStream.closeOutput()
         'msgbox "xml saved under: " & SaveFilename '[dbg]
</snip>

Don't worry about the If statements and what is happening in there,
because I took this code fragment out of a bigger macro that I have
written.
You can see that I use the [...]io.TextOutputStream, you would need to
apply the [...].io.ObjectOutputStream service of course.

I hope that the code is enough to give you the start. The IDL
reference, the Developer's Guide - and in case you need advanced
information about data sinks etc. the udk project page - should give
you enough information to write a good working implementation.

Hope this helps in some way.

Best Regards
Christian Junker

On Thu, 03 Feb 2005 16:01:25 +0100, Marc Santhoff
<[EMAIL PROTECTED]> wrote:
> Hi,
> 
> is there any chance of storing arbitrary writer text snippets (mostly
> TextRange ojects) into an OutputStream (or to a TextOutputStream
> represented as XML)?
> 
> Think of autotexts that are streamed away instead of being stored in any
> container file while not losing formatting ...
> 
> TIA,
> Marc
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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

Reply via email to