Public Type PathType
Folder As String '# Inclue le '\' final
FileName As String
FileExt As String '# Inclue le '.'
End Type
'# Permet de découper un chemin en dossier / nom de fichier / extension
Public Function CrackPath(ByVal vsInput As String) As PathType
Dim nPos As Long
If LenB(vsInput) Then
nPos = InStrRev(vsInput, "\")
If nPos Then
CrackPath.Folder = Left$(vsInput, nPos)
vsInput = Mid$(vsInput, nPos + 1)
End If
nPos = InStrRev(vsInput, ".")
If nPos Then
CrackPath.FileExt = Mid$(vsInput, nPos)
CrackPath.FileName = Left$(vsInput, nPos - 1)
Else
CrackPath.FileName = vsInput
End If
End If
End Function