2010年1月10日 星期日
學習記錄:OpenOffice Basic (5)
rem ##### 打開已有檔案(1)
Sub openfile01
sFile = "C:\Documents and Settings\Administrator\My Documents\nextSpreadsgeet.ods" ' Windows
'sFile = "/home/danny/Desktop/MyCalc.sxc" ' Linux
sURL = ConvertToURL(sFile)
oDoc = StarDesktop.loadComponentFromURL(sURL, "_blank", 0, Array())
End Sub
rem ##### 打開已有檔案(2)
rem 以 function fnOpenDoc(sFile) 簡化打開程序
sub openfile02
sFile = "C:\Documents and Settings\Administrator\My Documents\nextSpreadsgeet.ods"
oDoc = fnOpenDoc(sFile) ' Windows
'oDoc = fnOpenDoc("/home/danny/Desktop/MyCalc.sxc") ' Linux
end sub
function fnOpenDoc(sFile)
sURL = ConvertToURL(sFile)
fnOpenDoc = StarDesktop.loadComponentFromURL(sURL, "_blank", 0, Array())
end function
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言