import uno
def getReady():
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", localContext )
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()
return oDoc
oDoc = getReady()
oSheets = oDoc.getSheets()
## getting all sheet name
sheetNames = []
for loopi in range(oSheets.Count):
tmpSheet = oSheets.getByIndex(loopi)
sheetNames.append(tmpSheet.Name)
## get sorting
sheetNames.sort(reverse=True)
for tmpName in sheetNames :
oSheets.moveByName(tmpName, 0)
1/14/2011
HOWTO sort sheets using python
피드 구독하기:
글 (Atom)