How can the current pathname be returned without the document name as the following does?
MsgBox ThisComponent.getURL
Thanks...
[Solved] Return current pathname without document name
[Solved] Return current pathname without document name
Last edited by grnhorn on Fri Jul 25, 2008 5:35 pm, edited 1 time in total.
OOo 2.4.X on Ms Windows XP
-
- Volunteer
- Posts: 283
- Joined: Tue Dec 04, 2007 6:38 pm
- Location: Houston, TX
Re: Return current pathname without document name
There are various functions the in the Tools library.
Code: Select all
BasicLibraries.loadLibrary("Tools")
path=DirectoryNameoutofPath(ThisComponent.getURL(),"\")
msgbox path
Re: Return current pathname without document name
Thanks QuazzieEvil, but this also returns the filename attached. What I am looking for is the currentpath (current folder or directory) without the filename or.
OOo 2.4.X on Ms Windows XP
Re: Return current pathname without document name
Reverse the direction of the slash, i.e., "/".
[Solved] Return current pathname without document name
Thanks JohnV, that worked. I had to make one more change adding GlobalScope." Here is the final code.
GlobalScope.BasicLibraries.loadLibrary("Tools")
path=DirectoryNameoutofPath(ThisComponent.getURL(),"/")
msgbox path
GlobalScope.BasicLibraries.loadLibrary("Tools")
path=DirectoryNameoutofPath(ThisComponent.getURL(),"/")
msgbox path
OOo 2.4.X on Ms Windows XP