I know this is so easy but I can't think how to do it. I have a path e.g. C:\SomeDirectory\SomeSubDirectory\SomeFile.Ext
I want to break this into 2 strings
Str1: C:\SomeDirectory\SomeSubDirectory
Str2: SomeFile.Ext
Printable View
I know this is so easy but I can't think how to do it. I have a path e.g. C:\SomeDirectory\SomeSubDirectory\SomeFile.Ext
I want to break this into 2 strings
Str1: C:\SomeDirectory\SomeSubDirectory
Str2: SomeFile.Ext
VB Code:
'' Jamie Plenderleith '' '' Return the path of a given full path to a file '' Private Function returnPathOfFile(ByVal strFile As String) As String returnPathOfFile = Left(strFile, InStrRev(strFile, "\")) End Function '' Return the filename of a given full path to a file '' Private Function returnNameOfFile(ByVal strFile As String) As String returnNameOfFile = Mid(strFile, InStrRev(strFile, "\") + 1) End Function
Cheers :)