https://bugs.documentfoundation.org/show_bug.cgi?id=102933

            Bug ID: 102933
           Summary: MACRO: loadComponentFromURL fails
           Product: LibreOffice
           Version: 5.2.2.2 rc
          Hardware: x86 (IA32)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Base
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: mcmurchy1917-bugzi...@yahoo.co.uk

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to