Files

momoko

Registered User.
Local time
Today, 09:00
Joined
Oct 7, 2001
Messages
41
Hi,
I have the following file in c:\check

ABC_01Sep02_01.TTX
ABC_01Sep02_02.TTX
ABC_01Sep02_03.TTX

I need to rename all to the file to ABC.TTX. How can I read the file one by one, rename the first one and copy it to another directory, delete the first file and then process the second file etc.

Tks,
 
Paste this code into a module and call the function

''''''''''''''''''''''''''''''''''''''''''''
Option Compare Database

Function Copy_Delete_Files()
Dim FileNumber As Integer
Dim FileName As String

For FileNumber = 1 To 3
FileName = "ABC_01Sep02_0" & FileNumber & ".TTX"
FileCopy "C:\Check\" & FileName, "C:\Check\" & FileNumber & "\ABC.TTX"
Kill "C:\Check\" & FileName
Next FileNumber
End Function
''''''''''''''''''''''''''''''''''''''''''''

Smed
 

Users who are viewing this thread

Back
Top Bottom