+ Reply to Thread
Results 1 to 5 of 5

Copy folder and paste to another folder

  1. #1
    ddiicc
    Guest

    Copy folder and paste to another folder

    Hi there,
    Can anyone kindly tell me what is the script for the macro,
    for copying a folder, then pasting and overwrite to another folder.

    Pls help

  2. #2
    Bob Phillips
    Guest

    Re: Copy folder and paste to another folder

    Dim oFSO As Object
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    oFSO.CopyFolder "c:\mydocuments\*\*", "c:\tempfolder\", True


    --
    HTH

    Bob Phillips

    "ddiicc" <[email protected]> wrote in message
    news:[email protected]...
    > Hi there,
    > Can anyone kindly tell me what is the script for the macro,
    > for copying a folder, then pasting and overwrite to another folder.
    >
    > Pls help




  3. #3
    ddiicc
    Guest

    Re: Copy folder and paste to another folder

    Thanks alot Bob..

    "Bob Phillips" wrote:

    > Dim oFSO As Object
    > Set oFSO = CreateObject("Scripting.FileSystemObject")
    > oFSO.CopyFolder "c:\mydocuments\*\*", "c:\tempfolder\", True
    >
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > "ddiicc" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hi there,
    > > Can anyone kindly tell me what is the script for the macro,
    > > for copying a folder, then pasting and overwrite to another folder.
    > >
    > > Pls help

    >
    >
    >


  4. #4
    Registered User
    Join Date
    07-21-2005
    Posts
    6

    Question

    I am trying to do the same thing except my source directory changes with each operation.

    my_path2 = (source directory)
    my_save2 = (target directory)

    Dim fso As Object
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set a = fso.copyfolder(my_path2, my_save2, True)


    The directory gets copied except I get a Type mismatch error and my macro stops. I've tried all kinds of stuff and I can't get around the error.

  5. #5
    Registered User
    Join Date
    07-21-2005
    Posts
    6

    Thumbs up

    Nevermind. Looks like I had some issues with my string not being formatted correctly. Works perfect now. Bob, your code help get me back on track. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1