well, a starting point with that varaible exmaple
right(Mystr,InStr(4,Mystr, "\"

+1)
right function takes the count of a value from the right and the given numeric length in the parameter. In this case you give it the instr (position) of the 4 instance of the \.
but that will not help you with dynamic url's right. my suggestion is to use a match regex then
this is going to be fairly getneric but it will get you started off in the right direction
write a function to do the match first
this will be a example on a bases only of a valid path sent to the function:
Function RegExpTest(strng)
Dim regEx, Matches
Set regEx = New RegExp
regEx.Pattern = "\w*\.\w*"
' what this pattern says is
' any word (character) plus a "." plus the ext being the same to the regex as the file name
' you can do this as you shouldn't have . in the directory names
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(strng)
RegExpTest = Matches(0)
' you're only going to return one value so the mathc array is element 0
End Function
'test the function
MsgBox(RegExpTest("c:\folder1\folder2\folder3\filename.txt"

)
____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-3811