Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index

Jens Tröger schreef op 15/03/2015 om 14:02:
Thank you, Fernand!

    document = desktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, ())
    here you do not use any property value for opening "()"
Correct in this line, and the next few lines of code are:

    >>> from import PropertyValue
    >>> propVal = PropertyValue()
    >>> propVal.Name = "URL" # or "FileName"?
    >>> propVal.Value = "file:///path/to/document.odt"
    >>> document.load( (propVal,) )
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>

I have also tried to pass a property list directly to the call above,
but that just opened an empty Writer document:

    >>> document = desktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, (propVal,))

Perhaps "URL" or "FileName" are not the correct properties to open a

    your solution to open a writer doc is the "filter" property
    there are other available like "Hiden" ect..
Yes, all documented here:

        dim oProps(0) as new
            oProps2(1).Name = "FilterName"
            oProps2(1).Value = "HTML (StarWriter)"
    document = desktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, oProps())
Hope it helps
In this your example, how do you pass the actual document file name?
just replace

"private:factory/swriter" with the URL of your document , be sure its a URL bij converting it

using a OO native function: example converttoURL("c:\myfile.odt")

hope it helps



To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
All messages sent to this list will be publicly archived and cannot be deleted


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.