7 messages in org.openoffice.fr.progRe: [prog] Insertion de Champ utilisa...
FromSent OnAttachments
Alexandre MILLOTJul 8, 2004 2:16 am.gif
Tony GALMICHEJul 8, 2004 6:03 am 
Alexandre MILLOTJul 8, 2004 6:12 am.gif, .jpg
Bernard MarcellyJul 8, 2004 6:52 am 
Tony GALMICHEJul 8, 2004 7:03 am 
Tony GALMICHEJul 8, 2004 7:42 am 
Alexandre MILLOTJul 8, 2004 7:51 am.gif
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] Insertion de Champ utilisateur dans un tableauActions...
From:Tony GALMICHE (tony@plastigray.com)
Date:Jul 8, 2004 7:03:46 am
List:org.openoffice.fr.prog

Re-Bonjour,

Alexandre MILLOT a ecrit le 08/07/04 15:13 :

Pour que la macro fonctionne il faut créer le champ dans la liste des champs utilisateurs ( j'ai ecrit une autre macro pour ca).

Je comprends pas ce qu'i change entre etre dans la page ou etre dans une celleule de tableau. Je ne sais pas manipuler les tableaux.

Il faut créer le cursor dans la cellule et insérer le texte dans la cellule (cf macro ci-dessous)

En espérant avoir aidé.

Tony

----------------------------------------------------------- Sub InsertChampUtilisateur() oDoc=ThisComponent oChampUtilisateur = oDoc.createInstance("com.sun.star.text.TextField.User") strVarName="toto" sName = "com.sun.star.text.FieldMaster.User." + strVarName bFound = oDoc.getTextFieldMasters.hasbyname(sName) if bFound Then objFieldMaster = oDoc.getTextFieldMasters.getByName(sName) oChampUtilisateur.attachTextFieldMaster(objFieldMaster) oText = oDoc.getText oSels = ThisComponent.getCurrentSelection() ' Contient l'ensemble des sélections oSel = oSels.getByIndex(0) ' Contient la 1iere selection oCell=oSel.Cell 'Contient la cellule du tableau oCursor = oCell.createTextCursor() oCell.Text.insertTextContent(oCursor, oChampUtilisateur, false) oCell.Text.insertString(oCursor, " ", true) End If End Sub