7 messages in org.openoffice.fr.prog[prog] Insertion de Champ utilisateur...
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:[prog] Insertion de Champ utilisateur dans un tableauActions...
From:Alexandre MILLOT (alex@mistral.fr)
Date:Jul 8, 2004 2:16:38 am
List:org.openoffice.fr.prog
Attachments:

Bonjour,

J'ai ecrit une macro qui permet d'inserer un champ utilisateur à la position courante su curseur, or lorsque celui ci est dans un tableau j'ai un message d'erreur. Ci-Joint le code que j'utilise, merci d'avance.

Sub InsertChampUtilisateur(oDoc as Object, strVarName As String) oChampUtilisateur = oDoc.createInstance("com.sun.star.text.TextField.User ) sName = "com.sun.star.text.FieldMaster.User." + strVarName bFound = oDoc.getTextFieldMasters.hasbyname(sName) ' contrôle l'existence de la variable if bFound Then objFieldMaster = oDoc.getTextFieldMasters.getByName(sName) oChampUtilisateur.attachTextFieldMaster(objFieldMaster) oText = oDoc.getText ' Récupération du curseur visible de l'utilisateur oController = oDoc.currentController oViewCursor = oController.getViewCursor() oCursor = oText.createTextCursorByRange(oViewCursor) oText.insertTextContent(oCursor, oChampUtilisateur, false) oText.insertString(oCursor, " ", true) End If End Sub