OO-Snippets: connect via pipe

Commons

Keywords
LanguagePython
ApplicationOffice
AuthorsDarragh Sherwin (initial)
Tom Schindl (initial)
Supported Versions
Supported OSAll  
QuestionHow to connect to openoffice
Answer

Code is taken from a mail from Darragh Sherwin on dev@api.openoffice.org

Code-Snippet-Listing (snippet-source)

# Connection Details to connect
# over an InterProcess Communication (IPC)
# pipe to the running OpenOffice process
def connect():
    import uno
	localContext = uno.getComponentContext()
	resolver = localContext.ServiceManager.createInstanceWithContext( "com.sun.star.bridge.UnoUrlResolver",  localContext )
	remoteContext = resolver.resolve( "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" )
    return remoteContext

if __name__=="__main__":

        remoteContext = connect()

Changelog

DateUserModification
2005-10-15tomsontomInitial version

and