filesystemobject

A

Alvin Hansen

Hi

know this is excel forum but i don't know where else to write this

With filesystemobject i use createfolder and delete folder
but i can't find out how to use copy *.* from one folder to another folder

Hope some one can help --

Alvin
 
B

Bob Phillips

Hi Alvin ,

But you know how helpful we are :).

FileSystemObject.CopyFolder "c:\mydocuments\letters\*", "c:\tempfolder\"

These are the commenst on the MSDN page
If source contains wildcard characters or destination ends with a path
separator (\), it is assumed that destination is an existing folder in which
to copy matching folders and subfolders. Otherwise, destination is assumed
to be the name of a folder to create. In either case, four things can happen
when an individual folder is copied.

a.. If destination does not exist, the source folder and all its contents
gets copied. This is the usual case.
b.. If destination is an existing file, an error occurs.
c.. If destination is a directory, an attempt is made to copy the folder
and all its contents. If a file contained in source already exists in
destination, an error occurs if overwrite is false. Otherwise, it will
attempt to copy the file over the existing file.
d.. If destination is a read-only directory, an error occurs if an attempt
is made to copy an existing read-only file into that directory and overwrite
is false.
An error also occurs if a source using wildcard characters doesn't match any
folders.

The CopyFolder method stops on the first error it encounters. No attempt is
made to roll back any changes made before an error occurs.


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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