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
7/01/2010
openoffice start option enable python macro
openoffice calc should be run with the command
or edit /usr/bin/ooffice (in ubuntu)
$ ooffice -calc --accept="socket,host=localhost,port=8100;urp;StarOffice.ServiceManager"
or edit /usr/bin/ooffice (in ubuntu)
$ cat /usr/bin/ooffice
#!/bin/sh
/usr/lib/openoffice/program/soffice "$@" --accept="socket,host=localhost,port=8100;urp;StarOffice.ServiceManager"
$
6/29/2010
Extract icon from EXE file in ubuntu
$ wrestool -x -t14 TARGET.EXE -o result.icon
$ convert result.icon result.png
why -t14 ?
wrestool -l TARGET.EXE
-> shows a list of resources included in TARGET.EXE file, where type=14 (type=group_icon) is the icon image we want to extract.
-x option means extract
-o where to place extracted files
6/23/2010
Let google desktop find MS doc, xls, or ppt files
sudo apt-get install wv
sudo apt-get install catdoc
http://desktop.google.com/support/linux/bin/answer.py?hl=en&answer=76816
피드 구독하기:
글 (Atom)