资 源 简 介
GroovyUNO is a Groovy expander that simplifies access to methods and properties of UNO classes of OpenOffice/LibreOffice.
With GroovyUNO there is no need anymore to query interfaces or cast objects to XPropertySet. All properties and methods of an object are instantly available. Objects which support XNameAccess or XIndexAccess can be accessed conveniently with array operators.
Sample code:
```
import groovyuno.UNO
UNO.init()
def doc = UNO.desktop.currentComponent
def text = doc.getText()
start = text.getStart()
text.insertString(start, "Hello World!", false)
def cursor = text.createTextCursor()
cursor.gotoStart(false)
cursor.gotoEnd(true)
cursor.setPropertyValue("CharFontName", "Arial")
cursor.CharFontName = "Arial Black"
```