copy several files of a folder for other, using VBA?

Discussion in 'Microsoft Access Forms' started by Frank Dulk, Feb 20, 2005.

  1. Frank Dulk

    Frank Dulk Guest

    How do I do to copy several files of a folder for other, using VBA?
     
    Frank Dulk, Feb 20, 2005
    #1
    1. Advertisements

  2. Frank Dulk

    Paul Overway Guest

    Did you look at help for FileCopy?

    --
    Paul Overway
    Logico Solutions
    http://www.logico-solutions.com


    "Frank Dulk" <> wrote in message
    news:%23$...
    > How do I do to copy several files of a folder for other, using VBA?
    >
    >
     
    Paul Overway, Feb 20, 2005
    #2
    1. Advertisements

  3. Frank Dulk

    Frank Dulk Guest

    Did I already try but didn't I get, as it would be the code?

    "Paul Overway" <-solutions.com> escreveu na mensagem
    news:%...
    > Did you look at help for FileCopy?
    >
    > --
    > Paul Overway
    > Logico Solutions
    > http://www.logico-solutions.com
    >
    >
    > "Frank Dulk" <> wrote in message
    > news:%23$...
    > > How do I do to copy several files of a folder for other, using VBA?
    > >
    > >

    >
    >
     
    Frank Dulk, Feb 20, 2005
    #3
  4. Frank Dulk

    Paul Overway Guest

    FileCopy strSource, strDestination

    You don't understand that?

    --
    Paul Overway
    Logico Solutions
    http://www.logico-solutions.com


    "Frank Dulk" <> wrote in message
    news:%...
    > Did I already try but didn't I get, as it would be the code?
    >
    > "Paul Overway" <-solutions.com> escreveu na
    > mensagem
    > news:%...
    >> Did you look at help for FileCopy?
    >>
    >> --
    >> Paul Overway
    >> Logico Solutions
    >> http://www.logico-solutions.com
    >>
    >>
    >> "Frank Dulk" <> wrote in message
    >> news:%23$...
    >> > How do I do to copy several files of a folder for other, using VBA?
    >> >
    >> >

    >>
    >>

    >
    >
     
    Paul Overway, Feb 20, 2005
    #4
  5. Frank Dulk

    Frank Dulk Guest

    I understand.
    But as it would be to copy all the files?

    "Paul Overway" <-solutions.com> escreveu na mensagem
    news:%...
    > FileCopy strSource, strDestination
    >
    > You don't understand that?
    >
    > --
    > Paul Overway
    > Logico Solutions
    > http://www.logico-solutions.com
    >
    >
    > "Frank Dulk" <> wrote in message
    > news:%...
    > > Did I already try but didn't I get, as it would be the code?
    > >
    > > "Paul Overway" <-solutions.com> escreveu na
    > > mensagem
    > > news:%...
    > >> Did you look at help for FileCopy?
    > >>
    > >> --
    > >> Paul Overway
    > >> Logico Solutions
    > >> http://www.logico-solutions.com
    > >>
    > >>
    > >> "Frank Dulk" <> wrote in message
    > >> news:%23$...
    > >> > How do I do to copy several files of a folder for other, using VBA?
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >
     
    Frank Dulk, Feb 20, 2005
    #5
  6. You have to copy them one-by-one. If you're wanting to copy all files
    matching a particular pattern, use the Dir function to determine the files.

    --
    Doug Steele, Microsoft Access MVP

    (no e-mails, please!)



    "Frank Dulk" <> wrote in message
    news:%...
    >I understand.
    > But as it would be to copy all the files?
    >
    > "Paul Overway" <-solutions.com> escreveu na
    > mensagem
    > news:%...
    >> FileCopy strSource, strDestination
    >>
    >> You don't understand that?
    >>
    >> --
    >> Paul Overway
    >> Logico Solutions
    >> http://www.logico-solutions.com
    >>
    >>
    >> "Frank Dulk" <> wrote in message
    >> news:%...
    >> > Did I already try but didn't I get, as it would be the code?
    >> >
    >> > "Paul Overway" <-solutions.com> escreveu na
    >> > mensagem
    >> > news:%...
    >> >> Did you look at help for FileCopy?
    >> >>
    >> >> --
    >> >> Paul Overway
    >> >> Logico Solutions
    >> >> http://www.logico-solutions.com
    >> >>
    >> >>
    >> >> "Frank Dulk" <> wrote in message
    >> >> news:%23$...
    >> >> > How do I do to copy several files of a folder for other, using VBA?
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >
     
    Douglas J. Steele, Feb 20, 2005
    #6
  7. Frank Dulk

    Frank Dulk Guest

    They are files *.XLS

    "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> escreveu na mensagem
    news:...
    > You have to copy them one-by-one. If you're wanting to copy all files
    > matching a particular pattern, use the Dir function to determine the

    files.
    >
    > --
    > Doug Steele, Microsoft Access MVP
    >
    > (no e-mails, please!)
    >
    >
    >
    > "Frank Dulk" <> wrote in message
    > news:%...
    > >I understand.
    > > But as it would be to copy all the files?
    > >
    > > "Paul Overway" <-solutions.com> escreveu na
    > > mensagem
    > > news:%...
    > >> FileCopy strSource, strDestination
    > >>
    > >> You don't understand that?
    > >>
    > >> --
    > >> Paul Overway
    > >> Logico Solutions
    > >> http://www.logico-solutions.com
    > >>
    > >>
    > >> "Frank Dulk" <> wrote in message
    > >> news:%...
    > >> > Did I already try but didn't I get, as it would be the code?
    > >> >
    > >> > "Paul Overway" <-solutions.com> escreveu na
    > >> > mensagem
    > >> > news:%...
    > >> >> Did you look at help for FileCopy?
    > >> >>
    > >> >> --
    > >> >> Paul Overway
    > >> >> Logico Solutions
    > >> >> http://www.logico-solutions.com
    > >> >>
    > >> >>
    > >> >> "Frank Dulk" <> wrote in message
    > >> >> news:%23$...
    > >> >> > How do I do to copy several files of a folder for other, using

    VBA?
    > >> >> >
    > >> >> >
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >
     
    Frank Dulk, Feb 20, 2005
    #7
  8. Dim strDestinationFolder As String
    Dim strSourceFolder As String
    Dim strFile As String

    strDestinationFolder = "C:\Another Folder\"
    strSourceFolder = "C:\My Data\"

    strFile = Dir$(strSourceFolder & "*.XLS")
    Do While Len(strFile) > 0
    FileCopy strSourceFolder & strFile, strDestinationFolder & strFile
    strFile = Dir$()
    Loop


    --
    Doug Steele, Microsoft Access MVP

    (no e-mails, please!)



    "Frank Dulk" <> wrote in message
    news:%...
    > They are files *.XLS
    >
    > "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> escreveu na
    > mensagem
    > news:...
    >> You have to copy them one-by-one. If you're wanting to copy all files
    >> matching a particular pattern, use the Dir function to determine the

    > files.
    >>
    >> --
    >> Doug Steele, Microsoft Access MVP
    >>
    >> (no e-mails, please!)
    >>
    >>
    >>
    >> "Frank Dulk" <> wrote in message
    >> news:%...
    >> >I understand.
    >> > But as it would be to copy all the files?
    >> >
    >> > "Paul Overway" <-solutions.com> escreveu na
    >> > mensagem
    >> > news:%...
    >> >> FileCopy strSource, strDestination
    >> >>
    >> >> You don't understand that?
    >> >>
    >> >> --
    >> >> Paul Overway
    >> >> Logico Solutions
    >> >> http://www.logico-solutions.com
    >> >>
    >> >>
    >> >> "Frank Dulk" <> wrote in message
    >> >> news:%...
    >> >> > Did I already try but didn't I get, as it would be the code?
    >> >> >
    >> >> > "Paul Overway" <-solutions.com> escreveu na
    >> >> > mensagem
    >> >> > news:%...
    >> >> >> Did you look at help for FileCopy?
    >> >> >>
    >> >> >> --
    >> >> >> Paul Overway
    >> >> >> Logico Solutions
    >> >> >> http://www.logico-solutions.com
    >> >> >>
    >> >> >>
    >> >> >> "Frank Dulk" <> wrote in message
    >> >> >> news:%23$...
    >> >> >> > How do I do to copy several files of a folder for other, using

    > VBA?
    >> >> >> >
    >> >> >> >
    >> >> >>
    >> >> >>
    >> >> >
    >> >> >
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >
     
    Douglas J. Steele, Feb 21, 2005
    #8
  9. Frank Dulk

    Frank Dulk Guest

    Thank you very much.


    "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> escreveu na mensagem
    news:%...
    > Dim strDestinationFolder As String
    > Dim strSourceFolder As String
    > Dim strFile As String
    >
    > strDestinationFolder = "C:\Another Folder\"
    > strSourceFolder = "C:\My Data\"
    >
    > strFile = Dir$(strSourceFolder & "*.XLS")
    > Do While Len(strFile) > 0
    > FileCopy strSourceFolder & strFile, strDestinationFolder & strFile
    > strFile = Dir$()
    > Loop
    >
    >
    > --
    > Doug Steele, Microsoft Access MVP
    >
    > (no e-mails, please!)
    >
    >
    >
    > "Frank Dulk" <> wrote in message
    > news:%...
    > > They are files *.XLS
    > >
    > > "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> escreveu na
    > > mensagem
    > > news:...
    > >> You have to copy them one-by-one. If you're wanting to copy all files
    > >> matching a particular pattern, use the Dir function to determine the

    > > files.
    > >>
    > >> --
    > >> Doug Steele, Microsoft Access MVP
    > >>
    > >> (no e-mails, please!)
    > >>
    > >>
    > >>
    > >> "Frank Dulk" <> wrote in message
    > >> news:%...
    > >> >I understand.
    > >> > But as it would be to copy all the files?
    > >> >
    > >> > "Paul Overway" <-solutions.com> escreveu na
    > >> > mensagem
    > >> > news:%...
    > >> >> FileCopy strSource, strDestination
    > >> >>
    > >> >> You don't understand that?
    > >> >>
    > >> >> --
    > >> >> Paul Overway
    > >> >> Logico Solutions
    > >> >> http://www.logico-solutions.com
    > >> >>
    > >> >>
    > >> >> "Frank Dulk" <> wrote in message
    > >> >> news:%...
    > >> >> > Did I already try but didn't I get, as it would be the code?
    > >> >> >
    > >> >> > "Paul Overway" <-solutions.com> escreveu na


    > >> >> > mensagem
    > >> >> > news:%...
    > >> >> >> Did you look at help for FileCopy?
    > >> >> >>
    > >> >> >> --
    > >> >> >> Paul Overway
    > >> >> >> Logico Solutions
    > >> >> >> http://www.logico-solutions.com
    > >> >> >>
    > >> >> >>
    > >> >> >> "Frank Dulk" <> wrote in message
    > >> >> >> news:%23$...
    > >> >> >> > How do I do to copy several files of a folder for other, using

    > > VBA?
    > >> >> >> >
    > >> >> >> >
    > >> >> >>
    > >> >> >>
    > >> >> >
    > >> >> >
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >
     
    Frank Dulk, Feb 22, 2005
    #9
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Guest

    disable field until several other fields filled

    Guest, Oct 1, 2004, in forum: Microsoft Access Forms
    Replies:
    2
    Views:
    601
    Guest
    Oct 1, 2004
  2. Guest
    Replies:
    5
    Views:
    368
    Guest
    Feb 16, 2005
  3. Guest

    using a combo box to update several fields in a table

    Guest, Feb 26, 2005, in forum: Microsoft Access Forms
    Replies:
    1
    Views:
    216
    John Vinson
    Feb 27, 2005
  4. Guest
    Replies:
    0
    Views:
    194
    Guest
    Sep 12, 2006
  5. Guest

    Forms using several tables

    Guest, Oct 14, 2006, in forum: Microsoft Access Forms
    Replies:
    1
    Views:
    151
    Rick Brandt
    Oct 14, 2006
  6. Guest
    Replies:
    1
    Views:
    275
    Jeff Boyce
    Jun 21, 2007
  7. Dorian C. Chalom

    create folder/copy file to folder

    Dorian C. Chalom, Aug 10, 2008, in forum: Microsoft Access Forms
    Replies:
    1
    Views:
    297
    Douglas J. Steele
    Aug 11, 2008
  8. Frank Situmorang

    VBA to copy file from a folder to the other

    Frank Situmorang, Jan 27, 2009, in forum: Microsoft Access Forms
    Replies:
    2
    Views:
    658
    Frank Situmorang
    Jan 27, 2009
Loading...