
So as I mention on the show I talked about python binding to OpenOffice.org. I mantain a wiki page with a bunch of links to jump into Python and the UNO API of OOo.
I have examples divided into beginners, medium and hacker. You can check out the page here,
OpenOffice.org includes already some macros on Python on the default installation. You can find it here:
Code: Select all
/usr/lib/ooo-2.2/program/pythonloader.pyAlso the examples would be here:
Code: Select all
/usr/lib/ooo-2.2/share/Scripts/python/Code: Select all
# 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