OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Button to open certain folders from forms

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
NiksaVel
General User
General User


Joined: 25 Jan 2008
Posts: 14
Location: Croatia

PostPosted: Sun Nov 30, 2008 1:53 pm    Post subject: Button to open certain folders from forms Reply with quote

Hi all,

I was wondering if I could use a button to open a certain folder in the windows environment.. sorta like a global constant or something?

I'd like to open for instance... the current user's My Documents or My Pictures or the My Computer screen...

Is that at all possible?


I know I can make a shortcut to each and than call that shortcut, but I'd like a universal solution that would work on any computer without any prior setup if possible...
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
probe1
Moderator
Moderator


Joined: 18 Aug 2004
Posts: 2560
Location: Chonburi Thailand Asia

PostPosted: Sun Nov 30, 2008 9:11 pm    Post subject: Reply with quote

Create a pushbutton on your form.

Choose action: open Form/Website
type: "d:\whatever\folder" in URL

Does this help?
_________________
Cheers
Winfried
My Macros
DateTime2 extension: insert date, time or timestamp, formatted to your needs
Back to top
View user's profile Send private message Visit poster's website
NiksaVel
General User
General User


Joined: 25 Jan 2008
Posts: 14
Location: Croatia

PostPosted: Sun Nov 30, 2008 11:14 pm    Post subject: Reply with quote

No... I know I can do this... but I was wondering if there are some globals I couls use to open certain standard folders like "My Computer" or "My Documents" of the currently logged user...

i.e.like cd %SYSTEMROOT% in command prompt takes you to c:\windows, but it could also be c:\winnt or whatever
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
QuazzieEvil
Super User
Super User


Joined: 17 Jan 2007
Posts: 599
Location: Houston, TX

PostPosted: Mon Dec 01, 2008 6:01 am    Post subject: Reply with quote

you can use the Eviron(...) function to get some globals or the PathSubstition service--the Pathsubstition service is more adviceable as it is platform independent--Eviron(...) parameters differ between windows and linux. However, the Environ(..) funtion does give you other usefull info such as logged user name, and such.

See http://api.openoffice.org/docs/common/ref/com/sun/star/util/PathSubstitution.html for more info on the Path subsition service

Example:
Code:

  Dim ps as Object

 ps=createUnoService("com.sun.star.util.PathSubstitution")
 MsgBox "Temp Dir: " & ps.getSubstituteVariableValue("temp")

_________________
Free Docs @ http://www.baseprogramming.com/resources.html
Book @ lulu.com http://www.lulu.com/content/2455551
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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