Configure Libreoffice to listen for uno connection

Running LibreOffice version 4.0.4.2 on Windows 7 pro.

My understanding is if I write Python programs and run them externally to LibreOffice, then LibreOffice must be configured to listen for an uno connection.

How do I configure LibreOffice to listen for an uno connection?

Hallo

See the answers in this thread
No, ipython notebook ( now jupyter notebook ) is not necessary to run soffice in servermode, but IMHO it’s currently the best Environment for (small) interactiv Development from|with python.

to repeat the essential parts:

# run soffice as 'server'
from subprocess import Popen

officepath = 'soffice' #respectivly the full path
calc = '--calc'
pipe = "--accept=pipe,name=abraxas;urp;StarOffice.Servicemanager"
Popen([officepath, calc, pipe]);

# to connect as client
import uno
from pythonscript import ScriptContext

local = uno.getComponentContext()
resolver = local.ServiceManager.createInstance("com.sun.star.bridge.UnoUrlResolver")

client = resolver.resolve( "uno:pipe,"
                       "name=abraxas;"
                       "urp;"
                       "StarOffice.ComponentContext")
# for the conviniance of prior basic-adopters
createUnoService = client.ServiceManager.createInstance

# for (roughly) the same namespace as from "inside" soffice
XSCRIPTCONTEXT = ScriptContext(client, None, None)
1 Like