Darren DICK
darrend at nimble.com.au
Mon Aug 7 18:45:06 CDT 2006
Thank you William, thank you Andy (I'll speak to you later) and thank you John
I jumped on this morning - 3 replies - excellent - from eminent legends too -
woohoo
I feel like I have new toys to play with
Thanks guys - I really do appreciate it
Darren
------------------
T: 0424 696 433
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Skolits
Sent: Tuesday, 8 August 2006 1:13 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] A2003:Rename Files in a folder
Here ya' go:
Function RenameFiles()
Dim strFileName As String
Dim strPath As String
'Set Your Path
'***Important, Make sure you include the last backslash
strPath = "C:\Temp\"
'Return the 'first' filename in the folder
strFileName = Dir(strPath)
Do Until strFileName = ""
'rename it
Name strPath & strFileName As strPath & "INV" & strFileName
'If you just execute the DIR() function, it returns the next file in the
folder.
strFileName = Dir
Loop
End Function
John Skolits
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK
Sent: Monday, August 07, 2006 9:15 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] A2003:Rename Files in a folder
Hi all
I have to loop through a folder and rename all the files in it to have some
text
as a prefix
For EG there may be a folder C:\CoolFolder
In it may be 5 files or 5000 files that are all sequentially numbered and
named
like...
1012.pdf, 1013.pdf, 1014.pdf etc etc
What I need to do is loop all the files and add a prefix such as "inv" so
the
file names become
inv1012.pdf, inv1013.pdf, inv1014.pdf etc etc
Any pointers - anyone got any file renaming snippets they'd care to share?
many thanks in advance
Darren
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com