I have merged the Saving data to calc code with my exisiting code.However while saving the file in my exisitng code i have written as Save(XMLFilename) XMLFilename will be used and assigned everywhere in the project
But with Open Office i tried oDoc = oDesk.loadComponentFromURL(XMlfilename", "_blank", 0, arg) But it is giving error and this line
oDoc = oDesk.loadComponentFromURL("private:factory/scalc", "_blank", 0, arg)
Opens a new File always .I jus want it to ASSIGN IT with xmlfilename
Like Border,Image should be stored in the file whichever user selects and load that is XMLFilename
Can anybody suggest how to do this?
[Solved] Assign Existing FileName Instead of private:factory
[Solved] Assign Existing FileName Instead of private:factory
Last edited by Hagar Delest on Tue Nov 19, 2019 8:59 am, edited 2 times in total.
Reason: tagged solved
Reason: tagged solved
Open Office 4.1.7
Re: Assign Existing FileName Instead of private:factory/sca
oDoc = oDesk.loadComponentFromURL(XMlfilename", "_blank", 0, arg)
You have a " at the end of XMlfilename which shouldn't be there
Edit: assuming XMlfilename is a variable. If its a string you need another " in front of it. Make sure the path is a URL.
You have a " at the end of XMlfilename which shouldn't be there
Edit: assuming XMlfilename is a variable. If its a string you need another " in front of it. Make sure the path is a URL.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Assign Existing FileName Instead of private:factory/sca
I did try putting " before XMLFilename but it gives error
Also the XMLFilename is normal path not a URL
What to do?
Also the XMLFilename is normal path not a URL
What to do?
Open Office 4.1.7
Re: Assign Existing FileName Instead of private:factory/sca
There is a convertToURL() function you can use to make a URL
A couple of questions:
1. Is the variable really XMlfilename and not XMLfilename?
2. How is arg defined? If you just need an empty array as the last parameter of loadComponentFromURL(), you can use Array().
Code: Select all
XMLurl = convertToURL(XMlfilename)
oDoc = oDesk.loadComponentFromURL(XMLurl, "_blank", 0, arg)
1. Is the variable really XMlfilename and not XMLfilename?
2. How is arg defined? If you just need an empty array as the last parameter of loadComponentFromURL(), you can use Array().
Code: Select all
oDoc = oDesk.loadComponentFromURL(XMLurl, "_blank", 0, Array())
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: Assign Existing FileName Instead of private:factory/sca
Thank you all for the help
I used this line :
oDoc = oDesk.loadComponentFromURL("file:///" & XMLFilename.Replace("\", "/"), "_default", 0, arg)
and it worked
It now opens an existing file
I used this line :
oDoc = oDesk.loadComponentFromURL("file:///" & XMLFilename.Replace("\", "/"), "_default", 0, arg)
and it worked
It now opens an existing file
Open Office 4.1.7