How to copy files and get file name

M

Marco

Hello.

I'm trying to create a backoffice to a website.

I have a problem here. I need to copy the file from location on text1 to
location of text2 and update the text of text3.

I have this on the textboxs:

Text1: D:\1024x768.jpg

Text2: C:\website\images\2008

Text3: images/2008/

So I need to copy the file that is on location of text1 to text2 location
and updatte the text3.

This is what I have to have in text3 atfer update:
Text3: images/2008/1024x768.jpg


Is this possible to do?

Thanks,
Marco
 
K

Klatuu

CopyFile Me.Text1, Me.Text2
Me.Text3 =
Replace(Mid(Me.Text2,instr(instr(Me.Text2,"\")+1,Me.Text2,"\")+1) & "\" &
mid(Me.Text1,instr(Me.Text1,"\")+1),"\","/")
 
M

Marco

hello.

Thanks for your help.


Please clarify me a little bit more.

in VBA I just have to past this?

or I have to do something like: cmd CopyFile Me.Text1, Me.Text2

cheers,
Marco
 
M

Marco

Hello Klatuu.

Thanks to you I'm copying the files, thanks.

Another question. the command that you sent me regarding to get only the
file name it's just prepare to work if the files are in roots disks?

I tried to work with a photo that was on desktop and copy all path without
the C:\

Any thing that can be done?

Best Regards,
Marco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top