概述
有谁知道如何使用OO uno bridge api在Calc表中“全选”?
或者,找到最大使用的行和列号将起作用.
我想要做的是将格式应用于电子表格中的所有单元格.
(原因是我将工作表保存为csv,因此除非格式提供足够的小数位,否则数字不会准确保存.)
#get the sheet you want to work with,I'm just going to grab the first sheet
sheets = document.getSheets().createEnumeration()
sheet = sheets.nextElement()
#start with a range on the first cell
range = sheet.getCellRangeByPosition( 0,0 )
#expand to full extend of the used area
range.gotoEndOfUsedArea( True ) #true for expand selection
#no do whatever formatting things you want to do
总结
以上是编程之家为你收集整理的python – OpenOffice pyuno“全选”全部内容,希望文章能够帮你解决python – OpenOffice pyuno“全选”所遇到的程序开发问题。
如果您也喜欢它,动动您的小指点个赞吧