Apache OpenOffice (AOO) Bugzilla – Issue 115805
macro python dictionary
Last modified: 2017-05-20 09:37:59 UTC
I just add to a copy of HelloWorld.py inside C:\Users\computer\AppData\Roaming\OpenOffice.org\3\user\Scripts\python or in share\Scripts\python tr ={} tr[1]=1 then the function HelloWord is no more offered to choose as a macro to be executed remove tr[1]=1, it is ok... (Why I have to "choose" subcomponent www ? for this issue regrading macros)
.
I can not reproduce the problem. The following code seems working. 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)" tr ={} tr[1]=1 return None
Close as unabled to reproduce.