I've been running this code for a long long time without problems - oDoc = StarDesktop.loadComponentFromURL(sInURL, "MyFrame", 0, args0()) The line of code is contained in a macro which is called from a Button on a Base form. The purpose of the macro is to create a document and then convert the document created to a pdf. The aboove code now fails with a message box that contains this text - BASIC runtime error. An exception occurred Type: com.sun.star.lang.IllegalArgumentException Message: Unsupported URL <file:///home/alex/Documents/testoffice//BlueMerged0.odt>: "type detection failed". The above code works quite happily in LO 5.1.5.2 This is the code in context sub convertToPDF(strInFile AS String, strOutFile As String) writeToLogFile(time & " : " &"convertToPDF") Dim Dummy() Dim sInUrl As String Dim sOutUrl As String Dim oDoc As Object dim dispatcher as object dim args0(0) as new com.sun.star.beans.PropertyValue args0(0).Name = "Hidden" args0(0).Value = True REM Remove full stops from name sInUrl = ConvertToURL(strInFile) oDoc = StarDesktop.loadComponentFromURL(sInURL, "MyFrame", 0, args0()) sOutUrl = ConvertToURL(strOutFile) dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") document = oDoc.CurrentController.Frame
It would appear that loadComponentFromURL is correctly telling me that me that the file "file:///home/alex/Documents/testoffice//BlueMerged0.odt" doesn't exist. The reason for the non-existant file is some problem with mailmerge.