hi

well you could run trhough the string backwards and then detect the . and the \

for instance here is your function

Dim x As Long

Dim ext As String

Dim pos_ext As Long

Dim path As String

Dim file As String

Dim p As String

p = "c:\windows\system\Awview32.dll"

For x = Len(p) To 1 Step -1

If Mid(p, x, 1) = "." Then

ext = Mid(p, x, x)

pos_ext = x

ElseIf Mid(p, x, 1) = "\" Then

file = Mid(p, x + 1, (pos_ext - x) - 1)

path = Mid(p, 1, x)

Exit For

End If

Next

well you could run trhough the string backwards and then detect the . and the \

for instance here is your function

Dim x As Long

Dim ext As String

Dim pos_ext As Long

Dim path As String

Dim file As String

Dim p As String

p = "c:\windows\system\Awview3

For x = Len(p) To 1 Step -1

If Mid(p, x, 1) = "." Then

ext = Mid(p, x, x)

pos_ext = x

ElseIf Mid(p, x, 1) = "\" Then

file = Mid(p, x + 1, (pos_ext - x) - 1)

path = Mid(p, 1, x)

Exit For

End If

Next