3 messages in org.openoffice.fr.progun HelloWorld en python ?
FromSent OnAttachments
Axel RousseauMar 12, 2007 8:54 am 
Laurent GodardMar 12, 2007 9:10 am 
Bernard MarcellyMar 12, 2007 10:21 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:un HelloWorld en python ?Actions...
From:Axel Rousseau (arou@universalis.fr)
Date:Mar 12, 2007 8:54:03 am
List:org.openoffice.fr.prog

Bonjour, J'essaye de faire ma premiere macro en python, mais je suis un peu bloqué. J'ai créé un fichier dans le repertoire utilisateur (Application Data\OpenOffice.org2\user\Scripts\python) et ce fichier contient une méthode assez simple : def HelloWorldPython( ): """Prints the string 'Hello World(in Python)' into the current document""" #get the doc from the scripting context which is made available to all scripts model = XSCRIPTCONTEXT.getDocument() text = model.Text cursor = text.createTextCursor() text.insertString( cursor, "Hello World(in Python)", 0 )

Mais quand je vais dans "gérer les macros", je vois bien mon fichier, mais je ne vois pas en dessous ma méthode. Faut il déclarer les méthodes quelques parts ? y'a t'il certaines régles à suivre ?

J'ai essayé de relancer OOo, mais ça n'a rien changé.

Merci pour votre aide,

Axel