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

PickFolder Problems

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
PeteS
General User
General User


Joined: 12 Feb 2005
Posts: 43

PostPosted: Thu Apr 28, 2005 1:31 pm    Post subject: PickFolder Problems Reply with quote

Someone wrote the PickFolder function which allows the user to select a directory from a nice tree dialog. The code is as follows (note the cFolder argument):
Code:

Function PickFolder( cFolder )
   oFolderPickerDlg = createUnoService( "com.sun.star.ui.dialogs.FolderPicker" )
   If Len( cFolder ) > 0 Then
      oFolderPickerDlg.setDisplayDirectory( ConvertToURL( cFolder ) )
   EndIf
   oFolderPickerDlg.execute()
   cPickedFolder = oFolderPickerDlg.getDirectory()
   PickFolder = ConvertFromURL( cPickedFolder )
End Function

Here is how I use the function:
Code:

Sub SpecifyServerPath
      cFolder = PickFolder( "K:\" )
End Sub

I can not get it to start from a directory of my choosing. Even though I pass "K:\", it always starts from "My Computer". What am I missing?
Back to top
View user's profile Send private message
probe1
Moderator
Moderator


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

PostPosted: Thu Apr 28, 2005 2:36 pm    Post subject: Re: PickFolder Problems Reply with quote

PeteS wrote:
Someone wrote the PickFolder function which allows the user to select a directory from a nice tree dialog.


This code example is from DannyB
http://www.oooforum.org/forum/viewtopic.phtml?t=9797
Posted: Mon Jun 14, 2004 4:43 pm Post subject: Folder Picker and File Picker

wfm.
Your "K:\" is a network drive? connected? Maybe, try a "k:\" (small) or supply the UNC?
Sorry, I'm not running windows
_________________
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
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API 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