Rename folder and create new?

E

Ed

From within a Word macro, can I rename a folder and create a new folder? I
have Win2000 and Word2000.

Thanks for all the help.

Ed
 
D

Dave Lett

Hi Ed,

The FileSystemObject object has a CreateFolder method and GetFolder method.
Have a look at both in the VBA help file.

To change the name of the folder, you can use something like the following:

Dim fs, a
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.getfolder("f:\temp")
a.Name = a.Name & "Test"

HTH
 
E

Ed

Thank you, Dave.

Ed


Dave Lett said:
Hi Ed,

The FileSystemObject object has a CreateFolder method and GetFolder method.
Have a look at both in the VBA help file.

To change the name of the folder, you can use something like the following:

Dim fs, a
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.getfolder("f:\temp")
a.Name = a.Name & "Test"

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top