Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 209
Default filesystemobject

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default filesystemobject

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)


"Alvin Hansen" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default filesystemobject

The copyfile method - see
http://msdn.microsoft.com/library/de...gwithfiles.asp

"Alvin Hansen" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 209
Default filesystemobject

Yes yes yes

thank you, thank you

Alvin


"Bob Phillips" skrev:

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)


"Alvin Hansen" wrote in message
...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Scripting.FileSystemObject Leif Rasmussen Excel Discussion (Misc queries) 1 January 12th 05 11:21 PM
Help using FileSystemObject CopyFile Tod Excel Programming 1 May 12th 04 10:18 PM
FileSystemObject lol[_2_] Excel Programming 2 April 6th 04 09:56 PM
FileSystemObject Error AlexJ Excel Programming 3 February 29th 04 10:00 PM
Help with FileSystemObject? Ed[_9_] Excel Programming 2 August 5th 03 12:08 AM


All times are GMT +1. The time now is 06:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"