Thank for the help,
i'm be able to do it, i use findFirst and findNext with TextRange, as you suggest to me!
I have only another question: in my program i use to import others documents (file RTF) in a new blank document, insertDocumentFromURL, all is ok, but, in the
new document, there are some rows white (i think some paragraph maybe...)
My code is:
XText xText = null;
XTextCursor TextCursor = nll;
.....
xText = xTextDocument.getText();
xText.getStart();
TextCursor=xText.createTextCursor();
xd=(XDocumentInsertable) UnoRuntime.queryInterface(XDocumentInsertable.class,TextCursor);
xd.insertDocumentFromURL("file:///D:/Esempi/provaRTF.rtf",loadProps);
Why the system don't import form the TOP of the page??
Andrew Douglas Pitonyak ha scritto:
Hi Cristian, I do all of my examples in Basic.... Sorry! Cristian Fonti wrote:
Hi to all,
I'm a newbie in Api Open Office programmation with Java.
I have a writer document, and i want to search a "particular string", when i found it, i want to insert a PAGE BREAK.
On my web site, I recently posted a font document that inserts a page break at every other instance that is found. You need to use the latest beta to read the document, but here is also a PDF version. My free macro document has examples of these things as well (there is a link in this email message).
How can i do it??
I recommend that first you do it in Basic and then translate it over at least until you become more proficient in the API. So, a simple test in Basic, and then move it over to Java for the complete program.
First, create the find descriptor. You can either do a Find All, as I did, or you can iterate through each found instance and use find next. The found object can be used as a text range, which has the ability to set the page break command. You start a new page by setting the paragraph page style. I usually set it to the value that it already has so that I do not change the page style. It is the act of setting the page style that causes a page break.
Mi first, and big problem is how to use the objects that the interface com.sun.star.util.XReplaceable returns when i use the method findAll...
Please someone help me!
Thanks
Dott. Cristian Fonti
If this is not a sufficient hint, please say so. I would post some small examples, but my wife tells me that it is time to go.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dott. Cristian Fonti
mailto: [EMAIL PROTECTED]
Centro Elaborazione Dati (CED) - Resp. Web Area
SCM Group S.p.a. http://www.scmgroup.com
via Emilia, 77 - 47900 Rimini (RN), Italy
Tel.: +39 0541 700163 Interno: 2163
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
