|
-
May 14th, 2006, 03:51 PM
#1
Thread Starter
New Member
-
May 14th, 2006, 04:02 PM
#2
Re: Rename file using label caption?
To rename a file you can use 'Name filename As new filename'
VB Code:
Name "C:\abc.txt" As "C:\" & Label1.Caption & "_" & Label2.Caption & "_" & Label3.Caption & ".txt"
casey.
-
May 14th, 2006, 06:06 PM
#3
Thread Starter
New Member
Re: Rename file using label caption?
Thanks for your help casey,
Can I apply your suggestion if I am intending to use a common dialog to open the file (therefore file can be situated anywhere) and then allow the user to click a simple command button to rename the file?
Also, Am I correct in my thinking that renaming a file is also overwriting the existing file?
Thanks,
Jon.
-
May 14th, 2006, 06:28 PM
#4
Re: Rename file using label caption?
Yes. you can use that.
And also,
If you get an answer, please resolve the thread using Thread tools mark thread resolved.
-
May 14th, 2006, 06:45 PM
#5
Thread Starter
New Member
Re: Rename file using label caption?
Thanks, I'll try it again then. I would've resolved earlier if I knew it was resolved.
-
May 14th, 2006, 10:18 PM
#6
Re: Rename file using label caption?
 Originally Posted by Jon101
Also, Am I correct in my thinking that renaming a file is also overwriting the existing file?
No, you're not. Overwriting the file destroys all the data in the file at the time it's overwritten. Renaming it merely changes the name, but leaves the contents intact.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|