TableOfContents(2)

OpenOffice and Python

Start openoffice

openoffice -accept="socket,host=localhost,port=2002;urp;"

Connect to OpenOffice

python

import uno

local = uno.getComponentContext()

resolver = local.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", local)

context = resolver.resolve("uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext")

Modify Content

Load Services

desktop = context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", context)

document = desktop.getCurrentComponent()