| View previous topic :: View next topic |
| Author |
Message |
JeromeC General User

Joined: 13 Oct 2005 Posts: 37 Location: France - Nantes
|
Posted: Fri Nov 04, 2005 8:08 am Post subject: problem in the Open dialogbox |
|
|
Hi,
in Writer, i have a macro which sets the path of working documents :
| Code: | oPaths = CreateUnoService( "com.sun.star.util.PathSettings" )
oPaths.Work=ConvertToUrl("C:\documents and settings\user\doc\") |
I try to open the SaveAs Dialog box and it displays the path I set. But, in the Open dialogBox, the path is not correct: it keeps the path of the last opened document.
I read the api documentation for the pathsettings service (http://api.openoffice.org/docs/common/ref/com/sun/star/util/PathSettings.html) and with the Work property, the description is :"The path specified here can be seen in the Open or Save dialog." With the Open Dialogbox in Writer, it seems to be wrong...
I try to close and reopen Openoffice but it's the same thing.
In the Tool - Options menu, Load/save options, the check box "Load user config with the document" is really checked. (maybe the title of this checkbox is not correct, I don't have the english version, but it's this one).
Does anyone have this problem ?
Thanks. |
|
| Back to top |
|
 |
JeromeC General User

Joined: 13 Oct 2005 Posts: 37 Location: France - Nantes
|
Posted: Fri Nov 04, 2005 8:22 am Post subject: |
|
|
What is very trange is when, in my macro, I use the code :
oDoc=StarDesktop.LoadComponentFromUrl("ConvertToUrl("C:\documents and settings\user\doc\plan.odt"),"_blank",0,Array())
plan.odt is opened in the path I want but when I display the Open DialogBox, the path is still the path of the last opened document with the Open Dialog Box
So, with my problem, the only way to set the path of the Open dialogBox is to open a file manually, it doesn't work with a macro.
If someone has another solution in a macro, it would be great !!
Thanks ! |
|
| Back to top |
|
 |
ms777 Super User


Joined: 07 Feb 2004 Posts: 1355
|
Posted: Fri Nov 04, 2005 10:18 am Post subject: |
|
|
| Quote: | in Writer, i have a macro which sets the path of working documents :
Code:
oPaths = CreateUnoService( "com.sun.star.util.PathSettings" )
oPaths.Work=ConvertToUrl("C:\documents and settings\user\doc\")
I try to open the SaveAs Dialog box and it displays the path I set. But, in the Open dialogBox, the path is not correct: it keeps the path of the last opened document.
|
nice try ... but the only thing you do here is creating a local object named oPaths. Unfortunately, it is not that simple. If you want to change the OO configuration follow http://www.oooforum.org/forum/viewtopic.phtml?p=71961#71961. |
|
| Back to top |
|
 |
simonz General User

Joined: 18 Feb 2006 Posts: 6
|
Posted: Tue Mar 14, 2006 7:54 am Post subject: |
|
|
I run into the similar problem.
During my tests I found out the following:
After setting PathSettings.Work the file open dialog still starts at it's own "last_used value",
but clicking the house button ("Default directory") in the top right corner of the dialog changes to the desired directory!
So the "PathSettings.Work" value is not the current working directory as I understood it from the documentation.
Instead it is the main Work-Directory of OOo (the same as in Tools - Options - Paths - My Documents)!
That doesn't help solving your problem, but I hope I was able to give some info.
Perhaps you may want to have a look at my other posting regarding this:
http://www.oooforum.org/forum/viewtopic.phtml?p=133536#133536 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|