-
I've used the CommonDialog to get a path to a file.
It's working and I get back a path like:
"C:\test\test1\test.txt"
From the the ".FileName"
I only need the path though..... umm, I guess I was wondering the best way to get it to work.
I'm really just trying to get a path to an application from the user. I have the application name as the only filter selected - so the user has to either cancel or find the right file (so I know the path is valid).
-
looks like you have to roll your own
by removing chars back to the slash
Code:
Private Sub Form_Activate()
Dim p$, j%
CommonDialog1.ShowOpen
p = CommonDialog1.filename
For j = Len(p) To 5 Step -1
If Mid$(p, j, 1) = "\" Then Exit For
Next
Text1 = Left$(p, j - 1)
End Sub
-
Thanks!
I actually found the LEN command on my own - and was scratching my head wondering what to do with the returned lenght value.
:) - I could have never come up with that loop on my own though! THANKS