Emmery Chrisco

Emmery Chrisco

  • NA
  • 6
  • 9.5k

trim path from filename

Aug 5 2010 9:13 AM
I am trying to trim the path from a filename. With the following code, it returns "My Documents" where I should be getting "Test.txt". if I change the 1 to a 4 I get what I'm looking for, but that's not going to work if I'm working with a file deeper into subdirectories.
I need it to display the name of the file regardless of location or file type. Any ideas?
[code]    Private Sub trimname()
        Dim filelabel
        split = current.Split("\")
        filelabel = Trim(split(1))
        Elbow1.ButtonText = filelabel
    End Sub
[/code]

Answers (1)