import uno
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", localContext )
# note the port number is 8100, where the default value is 2002
ctx = resolver.resolve( "uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext" )
smgr = ctx.ServiceManager
desktop = smgr.createInstanceWithContext( "com.sun.star.frame.Desktop",ctx)
oDoc = desktop.getCurrentComponent()
# sheet to be activated
oSheet = oDoc.getSheets().getByIndex(2)
# activate the sheet
oController = oDoc.getCurrentController()
oController.setActiveSheet(oSheet)
# set first visible row
oController.setFirstVisibleRow(3)
7/02/2010
select (activate) a sheet in openoffice calc by python code
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기