Announcement

Collapse
No announcement yet.

Example Of FileSystemObject

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Example Of FileSystemObject



    I'm trying to use the CopyFolder Method in some VBA code.
    Guess I do not understand what a FileSystemObject is

    The following is from the VBA help
    Code:
    FileSystemObject.CopyFolder "C:\mydocuments\letters\*", "C:\tempfolder\"
    Can someone give me an example of what the FileSystemObject is or how to make this code work?

    Thanks
    Last edited by pt5014; November 6th, 2006, 22:30.

  • #2
    Re: Example Of A Filesystemobject

    an example of copyfolder method is shown below.

    Code:
    Sub copyfolder()
    Dim fso As Object
    Set fso = CreateObject("Scripting.FileSystemObject")
    fso.copyfolder "c:\a", "c:\b", 1
    End Sub
    This copies folder a to folder b and overwrites any files that conflict.
    Rich

    www.imits.co.uk - for all your training and development needs!

    Comment


    • #3


      Re: Example Of A Filesystemobject

      Thanks for the help

      Comment

      Working...
      X