openoffice-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernard Marcelly <marce...@club-internet.fr>
Subject Re: UNP API
Date Fri, 12 Apr 2013 12:22:54 GMT
Message de k.misha  date 2013-04-10 12:34 :
>
> How can I select a sheet in calc document?
>

You probably mean : display a particular sheet of a spreadsheet document.
The currently displayed sheet is called the Active Sheet.
You have to set it with the desired sheet object as argument.

REM -- With OpenOffice Basic easy coding ! ---
Dim myDoc As Object, mySheet As Object
myDoc = ThisComponent
mySheet =  myDoc.Sheets.getByName("October")
myDoc.CurrentController.ActiveSheet = mySheet


With Java or C++ you will have to query and use the methods:

Method        from  interface
.getSheets()  com.sun.star.sheet.XSpreadsheetDocument
.getCurrentController() com.sun.star.frame.XModel
.setActiveSheet(mySheet)  com.sun.star.sheet.XSpreadsheetView


Regards
   Bernard

---------------------------------------------------------------------
To unsubscribe, e-mail: api-unsubscribe@openoffice.apache.org
For additional commands, e-mail: api-help@openoffice.apache.org


Mime
View raw message