

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
3 messages in org.openoffice.fr.progRe: [prog] RE : [prog] autodimensionn...| From | Sent On | Attachments |
|---|---|---|
| Agnès Simonet | Jun 26, 2004 5:11 am | |
| michel tanguy | Jun 26, 2004 6:45 am | |
| Agnès Simonet | Jun 26, 2004 10:15 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [prog] RE : [prog] autodimensionnement d'un rectangleshape | Actions... |
|---|---|---|
| From: | Agnès Simonet (agne...@laposte.net) | |
| Date: | Jun 26, 2004 10:15:22 am | |
| List: | org.openoffice.fr.prog | |
Bonjour Michel, Oui ça aide ! Je ne comprends pas pourquoi ça ne marche pas avec un RectangleShape mais ta solution est parfaite. C'est pour une macro destinée à encadrer un mot ou plutot une sélection. La demande en a été faite sur la liste user. Un grand merci. Agnès S.
Le 26/06/04 15:46, michel tanguy a écrit :
bonjour Agnès
après quelques tests j'ai réussi à utiliser TextAutoGrowWidth dans ta macro en remplaçant
MonRectangle=MonDocument.createInstance("com.sun.star.drawing.RectangleS hape") par MonRectangle=MonDocument.createInstance("com.sun.star.drawing.TextShape" )
j'espere que cela pourra t'aider
bon week end Michel
-----Message d'origine----- De : Agnès Simonet [mailto:agne...@laposte.net] Envoyé : samedi 26 juin 2004 14:12 À : pr...@fr.openoffice.org Objet : [prog] autodimensionnement d'un rectangleshape
Bonjour,
Dans une macro, j'aimerais que la largeur de la forme s'adapte à celle du texte qu'elle contient. J'utilise TextAutoGrowWidth mais probablement mal puisque l'effet escompté n'est pas obtenu.
Voici la macro :
Dim MonDocument As Object, MonTexte As Object Dim MonCurseur As Object Dim CurseurVisible As Object Dim MonRectangle As Object Dim Taille1 As New com.sun.star.awt.Size
'dessine un rectangle de dimensions définies, là où de trouve le curseur 'positionne le curseur d'écriture MonDocument = ThisComponent MonTexte = MonDocument.Text CurseurVisible = MonDocument.currentcontroller.ViewCursor MonCurseur= MonTexte.createTextCursor MonCurseur = MonTexte.createTextCursorByRange(CurseurVisible) 'crée un rectangle de dimensions définies Taille1.Width = 5000 Taille1.Height = 2000 MonRectangle=MonDocument.createInstance("com.sun.star.drawing.RectangleS hape") MonRectangle.Size = Taille1 MonTexte.insertTextContent( MonCurseur,MonRectangle,false)
'adapte la largeur du rectangle à celle du texte MonRectangle.TextAutoGrowWidth = true
'texte dans le rectangle 'MonRectangle.String ="blablablablablablablablablablablablablablablabla"
Si quelqu'un pouvait m'éclairer.Merci
Agnès S.







