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

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.

-------Message original-------

De : pr@fr.openoffice.org Date : 07/08/04 15:04:06 A : pr@fr.openoffice.org Sujet : Re: [prog] Insertion de Champ utilisateur dans un tableau

Bonjour,

Alexandre MILLOT a écrit le 08/07/04 11:17 :

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.

Étant intéressé par la création de champs de formulaire par macro, j'ai regardé, mais je n'arrive pas à faire fonctionner ta macro même en dehors d'un tableau.

Autrement, j'ai trouvé sur OOoForum une macro qui permet de créer un bouton dans Calc.

Si ça peu aider....

Bonne chance

Tony

---------------------------------------------------------------------- Sub formsincalc()

Dim aPos as new com.sun.star.awt.Point Dim aSize as new com.sun.star.awt.Size

odoc = thisComponent 'create a form.. oform = odoc.createInstance( "com.sun.star.form.component.Form" )

'get the drawpage of the first sheet and insert the form there.. osheet = odoc.getSheets().getByIndex(0) odrawpage = osheet.getDrawPage() odrawpage.Forms.insertByName("MyForm", oform)

'now create a Shape that will visualize the Buttonmodel button_shape = odoc.createInstance("com.sun.star.drawing.ControlShape")

'Position of it.. aPos.X = 5000 aPos.Y = 7000 button_shape.Position = aPos

'Size of it.. aSize.Width = 3000 aSize.Height = 1600 button_shape.Size = aSize

'now create a simple button for it.. button_model = odoc.createInstance("com.sun.star.form.component.CommandButton") button_model.Name = "CmdButton" button_model.Label = "Click here"

'now connect model and shape with each other button_shape.Control = button_model

'now insert it into the form.. odrawpage.Forms.getByName("MyForm").insertByIndex(0, button_model)

'now add it to the drawpage so that it becomes visible.. odrawpage.add(button_shape)

End Sub