有谁知道如何使用OO uno brIDge API在Calc表中“全选”?
或者,找到最大使用的行和列号将起作用.
我想要做的是将格式应用于电子表格中的所有单元格.
(原因是我将工作表保存为csv,因此除非格式提供足够的小数位,否则数字不会准确保存.)
最佳答案假设您已连接到OpenOffice,文档是已打开或创建的电子表格.#get the sheet you want to work with,I'm just going to grab the first sheetsheets = document.getSheets().createEnumeration()sheet = sheets.nextElement()#start with a range on the first cellrange = sheet.getCellRangeByposition( 0,0 )#expand to full extend of the used arearange.gotoEndOfUsedArea( True ) #true for expand selection#no do whatever formatting things you want to do
总结 以上是内存溢出为你收集整理的python – OpenOffice pyuno“全选”全部内容,希望文章能够帮你解决python – OpenOffice pyuno“全选”所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)