OK found it myself :-)
found a solution on the forum
<http://www.oooforum.org/forum/viewtopic.phtml?t=43637>
The Streams must "seekable" for in the last part of the forum topic I
foundh some basic codes who do the trick and transforms the stream from
a database field to a "seekable" stream
thanks anyway
Fernand
Fernand Vanrie wrote:
Hi all,
The general idea is to put simple HTML coded text out of a database
field into a WriterDoc.The simple html tags like <B> etc.. has to been
transfered to the coresponding OO-style. Therefore I transfer the
fieldcontent to a stream and insert this stream using the HTML
(StarWriter) importfilter but the html tags are not translated to
OO-styling.
Doing the same from a file gives correct results
some basic code:
sub InsertfromStream
dim oProps(1) as new com.sun.star.beans.PropertyValue
oProps(0).Name = "InputStream"
oProps(0).Value = stream
oProps(1).Name = "FilterName"
oProps(1).VAlue = "HTML (StarWriter)"
Dim oTextViewCursor As Object
oTextViewCursor = ThisComponent.CurrentController.ViewCursor
Dim oDocumentInsertable As Object
oDocumentInsertable =
ThisComponent.Text.CreateTextCursorByRange(oTextViewCursor)
oDocumentInsertable.InsertDocumentFromURL("" , oProps()) end sub
file content like "set something in <b>bold</b>" gives "something in
<b>bold</b>"
I ame pretty sure the filter is doing something because using a
non-existing filer name gives somthing like s#o#m#e# etc....
sub Inserttfromdoc
dim oProps(1) as new com.sun.star.beans.PropertyValue
oProps(0).Name = "URL"
oProps(0).Value = "file:///H:/Teststream.txt"
oProps(1).Name = "FilterName"
oProps(1).VAlue = "HTML (StarWriter)"
Dim oTextViewCursor As Object
oTextViewCursor = ThisComponent.CurrentController.ViewCursor
oDocumentInsertable =
ThisComponent.Text.CreateTextCursorByRange(oTextViewCursor)
oDocumentInsertable.InsertDocumentFromURL("" , oProps()) end sub
file content like "set something in <b>bold</b>" gives "something in
*bold*"
Thanks for any hint
Fernand
---------------------------------------------------------------------
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]