Option Explicit Public Type tFileName sDrive As String * 1 sDir As String sFileName As String sFileExt As String End Type Public Sub pet_SplitPath(sbuff As String, ByRef FName As tFileName) Dim stemp As String Dim ipos As Integer stemp = sbuff With FName .sDrive = "" .sDir = "" .sFileName = "" .sFileExt = "" If Len(stemp) = 0 Then Exit Sub ipos = InStr(stemp, ".") If ipos > 0 Then .sFileExt = Mid(stemp, ipos) stemp = Mid(stemp, 1, ipos - 1) End If ipos = InStr(stemp, ":") If ipos > 0 Then 'drive letter = 1 letter .sDrive = Mid(stemp, 1, 1) stemp = Mid(stemp, ipos + 1) Else 'put code for default drive End If ipos = InStr(stemp, "\") Do While ipos > 0 .sDir = .sDir & Mid(stemp, 1, ipos) stemp = Mid(stemp, ipos + 1) ipos = InStr(stemp, "\") Loop .sFileName = stemp End With End Sub