:::
OOo使用者討論區
請教我可以到哪查VB呼叫OPEN OFFICE的元件資料
http://api.openoffice.org/SDK/index.html
http://api.openoffice.org/DevelopersGuide/DevelopersGuide.html
Developer's Guide 暫時我只見有簡體中文的翻譯 (StarOffice 8 版本):
http://docs.sun.com/app/docs/doc/819-1325?l=zh
http://api.openoffice.org/DevelopersGuide/DevelopersGuide.html
Developer's Guide 暫時我只見有簡體中文的翻譯 (StarOffice 8 版本):
http://docs.sun.com/app/docs/doc/819-1325?l=zh
志力建立 LibreOffice 的用戶和開發社群
Dim objserviceManager As Object
Dim objDesktop As Object
Dim objDocument As Object
Dim args()
Public Sub openoffice()
Set objserviceManager = CreateObject("com.sun.star.ServiceManager")
'Create the Desktop
Set objDesktop = objserviceManager.createInstance("com.sun.star.frame.Desktop")
'args is the necessiory params
Set objDocument = objDesktop.loadComponentFromURL("private:factory/scalc", "_blank", 0, args)
Set oSheet = objDocument.getSheets().getByIndex(0)
With oSheet
For i = 1 To 9
For j = 1 To 9
.getCellByPosition(i, j).setString (i & "*" & j & "=" & i * j)
Next
Next
End With
End Sub
Private Sub cmDwrite_Click()
Call openoffice
End Sub
Private Sub Command1_Click()
Dim open_office_name As String
open_office_name = "calc.ods"
'xxx = "file:///" & Replace(xxx, "/","\/
Path = Replace(App.Path & "\" & open_office_name, "\ ", "/")
objDocument.storeToURL "file:///" & Path, args
objDocument.Close (True)
Label1.Caption = "Have write the file to your computer the path is : " & App.Path & "\" & open_office_name
End Sub
Dim objDesktop As Object
Dim objDocument As Object
Dim args()
Public Sub openoffice()
Set objserviceManager = CreateObject("com.sun.star.ServiceManager")
'Create the Desktop
Set objDesktop = objserviceManager.createInstance("com.sun.star.frame.Desktop")
'args is the necessiory params
Set objDocument = objDesktop.loadComponentFromURL("private:factory/scalc", "_blank", 0, args)
Set oSheet = objDocument.getSheets().getByIndex(0)
With oSheet
For i = 1 To 9
For j = 1 To 9
.getCellByPosition(i, j).setString (i & "*" & j & "=" & i * j)
Next
Next
End With
End Sub
Private Sub cmDwrite_Click()
Call openoffice
End Sub
Private Sub Command1_Click()
Dim open_office_name As String
open_office_name = "calc.ods"
'xxx = "file:///" & Replace(xxx, "/","\/
Path = Replace(App.Path & "\" & open_office_name, "\ ", "/")
objDocument.storeToURL "file:///" & Path, args
objDocument.Close (True)
Label1.Caption = "Have write the file to your computer the path is : " & App.Path & "\" & open_office_name
End Sub

