有谁知道如何使用 OO uno 桥接 api 在 Calc 工作表中“选择全部”?
或者,找到最大使用的行数和列数也可以。
我想要做的是将格式应用于电子表格中的所有单元格。
(原因是我将工作表保存为 csv,因此除非格式提供足够的小数位,否则数字不会准确保存。)
假设您已经连接到 OpenOffice 并且document
是已打开或创建的电子表格。
#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, 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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)