Assuming that you're running this on the same machine where the files exist,
Dir("hghghg/hgjhgh/ghfgg/gfgf/product76-x3/image1.jpg") will return only the
file name (image1.jpg). Getting product76-x3 is a bit more problematic.
Knowing the file name, you can remove it from the string using
Left(FullPath, Len(FullPath) - Len(FileName)-1). (The -1 is necessary to
remove the slash before the file name). You could then use the InStrRev
function to find out where the last slash is (the one before product76-x3)
and use the Mid function to retrieve the folder name.
If you're not running this on the same machine where the files exist, you
can use InStrRev to get the file name as well.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
<da*********@scene-double.co.uk> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi,
I'm using the FileOpenDialog API that everyone has told me about which
is posted everywhere on this forum.....works like a dream. When I
select a file I get the full path such as :
hghghg/hgjhgh/ghfgg/gfgf/product76-x3/image1.jpg
What I require is to place 'product76-x3' in one variable and
image1.jpg in a second, in order for me to create a new string URL.
I'm not quite sure how to use the trim function to retrieve both ?
Thanks
David Gordon