List Info

Thread: Re: Inserting an RTF stream




Re: Inserting an RTF stream
user name
2007-02-06 00:57:09
Hello,

is there somebody out here who can help me with this
problem. Or is this 
maybe the wrong mailinglist / newsgroup, so I will post it
in a another one. 
Which mailinglist / newsgroup will be the right one for this
question.

Regards Markus

"Markus Buch" <buchkometmetall.de> schrieb
im Newsbeitrag 
news:eq6q3d$vov$1sea.gmane.org...
> Hello,
>
> I'm trying to insert an RTF stream to a
"OpenOffice" instance running 
> inside the "OOoBean". Here is the code for
this.
>
> XDocumentInsertable xDocInsertable =
(XDocumentInsertable) 
> UnoRuntime.queryInterface(XDocumentInsertable.class,
xTextCursor);
>
> PropertyValue[] loadProps = new PropertyValue[1];
> loadProps[0] = new PropertyValue();
> loadProps[0].Name = "FilterName";
> loadProps[0].Value = "Rich Text Format";
>
> loadProps[1] = new PropertyValue();
> loadProps[1].Name = "InputStream";
> loadProps[1].Value = new
ByteArrayToXInputStreamAdapter(data);
>
>
xDocInsertable.insertDocumentFromURL("private:stream&qu
ot;, loadProps);
>
> But I always get an
"com.sun.star.lang.IllegalArgumentException" and
don't 
> understand what's the problem. When I'm using the
function 
>
XComponentLoader.loadComponentFromURL("private:stream&q
uot;, "_blank", 0, 
> loadProps) instead of 
>
XDocumentInsertable.insertDocumentFromURL("private:stre
am", loadProps) 
> everything works fine.
>
> But the problem is I'd like to insert some RTF
formatted text in a running 
> "OpenOffice" instance at the current position
of the cursor. So I think 
> the function insertDocumentFromURL is the better
choice, because with this 
> I can insert it at the current position of the cursor.
So please can 
> someone help me trying to fix the problem.
>
> Regards Markus 



------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )