您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

python – OpenOffice pyuno“全选”

5b51 2022/1/14 8:21:20 python 字数 1064 阅读 469 来源 www.jb51.cc/python

有谁知道如何使用OO uno bridge api在Calc表中“全选”?或者,找到最大使用的行和列号将起作用.我想要做的是将格式应用于电子表格中的所有单元格.(原因是我将工作表保存为csv,因此除非格式提供足够的小数位,否则数字不会准确保存.)最佳答案假设您已连接到OpenOffice,文档是已打开或创建的电子表格.#get the sheet you w

概述

有谁知道如何使用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“全选”所遇到的程序开发问题。


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶