Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i create a "up one level" button

Status
Not open for further replies.

kruxty

Programmer
Jul 17, 2001
197
PT
Windows have a "up one level button", that provides us to up on level in our folders.
What i want to know is the code for this button.

Tkx for all
Kruxty,

:eek:)
 
And if anyone know what is the code for creating a new folder?

Tkx again
;O)
 
This function should be what you're looking for:

Private Function GetFilePath(FileName As String) As String
Dim i As Long
For i = Len(FileName) To 1 Step -1
Select Case Mid$(FileName, i, 1)
Case ":"
' colons are always included in the result
GetFilePath = Left$(FileName, i)
Exit For
Case "\"
' backslash aren't included in the result
GetFilePath = Left$(FileName, i - 1)
Exit For
End Select
Next
End Function

'This will return one directory less than FileName, as long as FileName doesn't end in a fwdslash (\)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top