Am Mittwoch, den 04.08.2010, 12:59 +0200 schrieb Thomas Krumbein:
> Hey Marc,
>
> Marc Santhoff schrieb:
> [..]
> > I would rather change the macro using another technique, ucb or the
> > like, for writing files than tell the users to install something else
> > (because my macro program is not able to ...).
>
> I am writing my csv files using ucb. In this case I can even pass the
> encoding-type for output file.
>
> So, try this:
>
> oSFA = createUnoService("com.sun.star.ucb.SimpleFileAccess")
> oOutputStream = createUnoService("com.sun.star.io.TextOutputStream")
>
> oDatei = oSFA.OpenFileReadWrite(sURL) 'sURL should be the URL of your
> csv-file
>
> oOutputStream.SetOutputStream(oDatei.getOutPutStream)
>
> sString = "this is your text(first line)..." & chr(13) & chr(10)
> sString = sString & "and now line 2..."
>
> oOutputStream.writeString(sString)
>
> 'Again add a windows line-feed:
> oOutputStream.writeString(chr(13) & chr(10))
>
> 'close the file
> oOutPutStream.closeOutput()
Beautiful, you made my day. :)
Many thanks,
Marc
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]