Rename a .pdf file in vb6.0

Hi,
How can I rename a .pdf at runtime in vb6.0

Cheers
RIASAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JackOfPHCommented:
FileCopy("C:\OriginalFile.PDF", "C:\RenamedFile.PDF")
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JackOfPHCommented:
or this
Name "c:\OriginalFile.pdf" As "c:\RenamedFile.pdf"

Open in new window

0
RIASAuthor Commented:
but that will remove the file from original folder is it cut paste
I need to do saveas on file example:
C:\abc.pdf
copy it to and not cut
F:\fgh.pdf ---renaming and copying
End result expected:
C:\abc.pdf still exists and also have F:\fgh.pdf


Cheers
0
cspgujaratCommented:
Hi,

Consider that you have file called ABC.PDF on C:

Solution is for you as under:

If you want to copy ABC.PDF file on F: then Code will be as follow:

FileCopy "C:\Abc.pdf" "F:\xyz.pdf"


If you want to move Abc.Pdf file on F: as Xyz.pdf then Code will be as follow:

FileCopy "C:\Abc.pdf" "F:\xyz.pdf"
Kill "C:\Abc.pdf"


If you wish the same name for moved file, then you can use same name in Target Name parameter


CSP Gujarat
0
JackOfPHCommented:
Then use my first post:




FileCopy "C:\OriginalFile.PDF", "F:\fgh.pdf" 

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.