
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!