5

OO uno bridge API を使用して Calc シートで「すべてを選択」する方法を知っている人はいますか?

または、使用されている行と列の最大数を見つけることもできます。

私がやりたいことは、スプレッドシートのすべてのセルに書式を適用することです。

(理由は、シートを csv として保存しているため、形式が十分な小数点以下の桁数を提供しない限り、数値が正確に保存されないためです。)

4

2 に答える 2

2

すでに 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
于 2011-04-06T14:23:24.513 に答える