VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This code lets you get only the path from a common dialog control. Can be very useful.

by Steven Bailey (Cyrix) (2 Submissions)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Mon 7th February 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This code lets you get only the path from a common dialog control. Can be very useful.

Rate This code lets you get only the path from a common dialog control. Can be very useful.




Private Sub Command1_Click()
Dim x As String
Dim y As Integer
CommonDialog1.Filter = "All Files [*.*]|*.**"
CommonDialog1.ShowOpen
x = CommonDialog1.FileName

For i = 1 To 255

If Mid(x, i, 1) = "\" Then
y = i
End If

Next i

Text1.Text = Mid(x, 1, y)
End Sub



Download this snippet    Add to My Saved Code

This code lets you get only the path from a common dialog control. Can be very useful. Comments

No comments have been posted about This code lets you get only the path from a common dialog control. Can be very useful.. Why not be the first to post a comment about This code lets you get only the path from a common dialog control. Can be very useful..

Post your comment

Subject:
Message:
0/1000 characters