PyUNO
Os Debian 5.*
OOo 3.2.1
ImportError: No module named com.sun.star.lang.XMultiComponentFactory
amber@working:/opt/openoffice.org3/program$
I tried write code for Dialog following logics of
http://wiki.services.openoffice.org/wik ... f_a_Dialog
http://udk.openoffice.org/python/python-bridge.html (FAQ13 Java versus python)
and example from
http://www.oooforum.org/forum/viewtopic ... 263#304263
Code: Select all
import uno
import com.sun.star.lang.XMultiComponentFactory as XMultiComponentFactory
#mportError: No module named com.sun.star.lang.XMultiComponentFactory
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", localContext )
ctx = resolver.resolve( "uno:socket,host=localhost,port=2003;urp;StarOffice.ComponentContext")
smgr = ctx.ServiceManager
desktop = smgr.createInstanceWithContext( "com.sun.star.frame.Desktop", ctx)
doc1=desktop.getCurrentComponent()
text1 = doc1.Text
xMFC=XMultiComponentFactory
oDialogModel=xMFC.createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", localContext)