Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does anyone know how to RENAME a file.

Status
Not open for further replies.

daldous

Technical User
Feb 23, 2002
22
0
0
US
Hi,

I'm new to VB6. I'm trying to Rename a photo file (newfilename.jpg, or any other extender. I bought three VB6 booksI can't find any command, keyword or function to do this. Very frustrating for such a simple need!!

I have the same problem with saving a file. (???)

What is the process that is required?

Please help.

Thanks,

Frustrated in Sacramento,

daldous
 
Hi,

Use the Name statement to rename e.g.

Dim OldName, NewName
OldName = "OLDFILE": NewName = "NEWFILE" ' Define file names.
Name OldName As NewName ' Rename file.

OldName = "C:\MYDIR\OLDFILE": NewName = "C:\YOURDIR\NEWFILE"
Name OldName As NewName ' Move and rename file.

Could be a little specific about the save problem.

Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top