How do I set path current from dir1 and drive1 objects 
Author Message
 How do I set path current from dir1 and drive1 objects

Hi my name is Russ (head hung low) and I am a newbe.

I can select the Drive and Directory but I cant make it the active
directory in Command1_Click().

This is what I have so far.

Private Sub Command1_Click()
'I need to set the path in this section to
'that which is selected from the objects
' Drive1, Dir1 and File1below

'My program goes here where I
"read and write files from the selected dir

End Sub
===================================
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

===================================
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub

===============================
Private Sub File1_Click()
File1.Path = Dir1.Path
End Sub

Thank you for any help



Sun, 19 Mar 2000 03:00:00 GMT  
 How do I set path current from dir1 and drive1 objects

Quote:

> Hi my name is Russ (head hung low) and I am a newbe.

(all together, now) Hi, Russ!

Quote:
> I can select the Drive and Directory but I cant make it the active
> directory in Command1_Click().
> This is what I have so far.
> Private Sub Command1_Click()
> 'I need to set the path in this section to
> 'that which is selected from the objects
> ' Drive1, Dir1 and File1below

ChDrive File1.Path ' you may not need to change to the drive and dir
ChDir File1.Path ' if you don't, you'll be able to use UNC paths!

Quote:
> 'My program goes here where I
> "read and write files from the selected dir

dim DirName as string: DirName = File1.Path
if (right$(DirName, 1) <> "\") then DirName = DirName & "\"

if File1.MultiSelect <> 0 ' can multiple files be selected?

  dim i as integer: for i = 0 to File1.listcount - 1
    if File1.Selected(i) Then do stuff with (DirName & File1.List(i))
  next

elseif File1.ListIndex >= 0 ' is a file selected?

  do stuff with (DirName & File1.List(File1.ListIndex))

endif

Quote:
> End Sub
> ===================================
> Private Sub Dir1_Change()
> File1.Path = Dir1.Path
> End Sub
> ===================================
> Private Sub Drive1_Change()
> Dir1.Path = Drive1.Drive
> End Sub
> ===============================
> Private Sub File1_Click()
> File1.Path = Dir1.Path
> End Sub
> Thank you for any help

--
Joe Foster <mailto:joe*AT*bftsi0.gate.net> Spam is irrelevant.
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!


Sun, 19 Mar 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Setting the path to the path of the current application

2. How do I set Drive1 to My Network Places

3. how to change dir1 path

4. Setting path to location of current mdb file

5. Problem using GetPrivateProfile to set current path

6. Set/get current row using table object

7. Object doesn't support current locale setting (Error 447)

8. setting all foreground and bkground colors to use window's current color setting

9. Set Word Path to Path of Current Document -- How to?

10. File1/Drive1 List Boxes

11. Finding path of current database?

12. current database path

 

 
Powered by phpBB® Forum Software