Bonjour
il y a un HelloWorld dans C:\program files
voici sous linux, mais c'est la meme chose
$ cat /opt/openoffice.org2.1/share/Scripts/python/HelloWorld.py
# HelloWorld python script for the scripting framework
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()
#get the XText interface
text = model.Text
#create an XTextRange at the end of the document
tRange = text.End
#and set the string
tRange.String = "Hello World (in Python)"
return None
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
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 ?
tu n'as pas de return None
(je ne sais pas si ca joue)
essaye egalement de deplacer ta macro python dans share plutot que user
pour voir
Laurent