8 messages in org.openoffice.fr.progRe: [prog] Ecrire du texte dans une s...
FromSent OnAttachments
Tony GALMICHEJun 18, 2004 8:23 am 
Bernard MarcellyJun 19, 2004 1:01 am 
Agnès SimonetJun 19, 2004 1:56 am 
BobJun 19, 2004 2:33 am 
Tony GALMICHEJun 20, 2004 9:39 am 
Tony GALMICHEJun 20, 2004 9:40 am 
Agnès SimonetJun 21, 2004 10:08 am 
Tony GALMICHEJun 21, 2004 10:25 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [prog] Ecrire du texte dans une section particulièreActions...
From:Agnès Simonet (agne@laposte.net)
Date:Jun 19, 2004 1:56:58 am
List:org.openoffice.fr.prog

Le 18/06/04 17:24, Tony GALMICHE a écrit :

Re-bonjour à tous,

Je suis toujours avec mes sections, et je n'arrive pas à écrire du texte dans une section que j'ai créée et dont je connais le nom.

Je sais positionner un Cursor n'importe où dans un document texte et écrire du texte, mais je n'arrive pas à le positionner sur la dernière ligne de la Section nommée "TrucMuch"

Ex : Le code suivant écrit à la fin du document alors que je voudrais qu'il écrive à la fin de la section "NomSection"

oSection = oDoc.GetTextSections.GetByName("NomSection") oCursor=oSection.GetAnchor.GetText.createTextCursor() oCursor.gotoEnd(0) oDoc.Text.insertString(oCursor, "toto et tutu", FALSE)

Dim oDoc As Object Dim oTexte As Object Dim oSection As Object Dim oAnchor As Object Dim oCursorFin As Object

oDoc = ThisComponent oTexte = oDoc.Text oSection = oDoc.GetTextSections.GetByName("TrucMuch") oAnchor=oSection.GetAnchor() oCursorFin=oTexte.createTextCursorByRange(oAnchor.getEnd())

oTexte.insertString(oCursorFin, "toto et tutu", FALSE)

Ça marche !

Agnès S.