Ubuntu OpenOffice macro ods convert xls

 


OpenOffice ods格式转换为xls

sub SaveAs
    Dim URLStr as String
    Dim FileName as String
'    Dim dispatcher as object
    Dim document as object
    
    Dim oProp(1) As New com.sun.star.beans.PropertyValue
'    document   = ThisComponent.CurrentController.Frame
'    dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
    document = ThisComponent
    GlobalScope.BasicLibraries.LoadLibrary("Tools")
    
'    dim args1(1) as new com.sun.star.beans.PropertyValue
        URLStr = ThisComponent.getURL()
    FileName = FileNameOutOfPath(URLStr)
    print URLStr
    'print FileName
    
    
'    args1(0).Name = "URL"
'    args1(0).Value = URLStr
'    args1(1).Name = "FilterName"
'    args1(1).Value = "calc8"
    oProp(0).Name = "overWrite"
    oProp(0).value= true
    oProp(1).Name = "FilterName"
    oProp(1).Value = "calc8"
    document.storeasurl(URLStr, oProp())    
'    dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, args1())
end sub

{backbutton}

提交评论

安全码
刷新

附加信息