467,894 Members | 1,750 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,894 developers. It's quick & easy.

How to rename a filename in a system folder with VBA code

Dear reader,

I have a table with two fields, the fields are FileNameOld and FileNameNew.

Now I am looking for VBA code to search in a system folder for the
FileNameOld and change the filename to the FileNameNew.

I am thankful for any help.
Kind regards,
Simon
Oct 8 '06 #1
  • viewed: 3903
Share:
1 Reply
Simon wrote:
Dear reader,

I have a table with two fields, the fields are FileNameOld and
FileNameNew.

Now I am looking for VBA code to search in a system folder for the
FileNameOld and change the filename to the FileNameNew.

I am thankful for any help.
Kind regards,
Simon
Dir("path to file") will tell you if the file exists. It will return the file
name if it does or return a zero length string "" if it does not.

The Name command can be used to change the name once you determine that the file
does exist.

Name "full path to old file name" As "full path to new file name"
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Oct 8 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by fanbanlo | last post: by
17 posts views Thread by tom | last post: by
8 posts views Thread by Merlin | last post: by
3 posts views Thread by Yannick Benoit | last post: by
6 posts views Thread by shuaishuaiyes | last post: by
reply views Thread by aris1234 | last post: by
1 post views Thread by shapper | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.