// ##### Open template file ######
url = "file://server4/AxaptaSP4/Template/IV/Costing2.ods";
OpenOffice = new Com("com.sun.star.ServiceManager");
oDeskTop = OpenOffice.CreateInstance("com.sun.star.frame.Desktop");
arg = COMVariant::createFromArray(arr);
oDocument = oDeskTop.LoadComponentFromURL(url, "_blank", 0, arg);
oSheets = oDocument.getSheets();
// ##### Save as temp file ######
DeleteFilesInFolder("C:/AxaptaSP4/Temp/IV/Costing2.ods");
outFile = strfmt("file:///C:/AxaptaSP4/Temp/IV/Costing2-%1.ods",timenow());
oDocument.storeAsURL(outFile,arg)
/////////////////////////ปิดไฟล์/////////////////////////////////////
oDocument.dispose();
No comments:
Post a Comment