Results 1 to 5 of 5

Thread: Please help: selecting file after file.

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Posts
    4
    Hi!
    I have an application which needs to open a particular
    directory, get a file , perform some operation on it and
    move it to a different directory, then go to next file
    and do the same thing..until the directory is empty.
    The user just open's the particular directory and program has to do the rest automatically. Also I want to see the fileOpen dialog box during this process.
    Please help.
    --Kavitha

  2. #2
    Fanatic Member wildcat_2000's Avatar
    Join Date
    Nov 2000
    Location
    Italy
    Posts
    727
    To establish a list file of a specific directory use this code.

    Code:
    'search for files in the specified folder
        Dim fs, f, f1, fc, s
        Set fs = CreateObject("Scripting.FileSystemObject")
        Set f = fs.getfolder("c:\test")
        Set fc = f.Files
        For Each f1 In fc
            fsubm = fsubm + 1
            filess(fsubm) = f1.Name  'define list of files
        Next
    You will have files(a) the files of your directory (fsubm is the total number of files in the directory)

    Then you can just process the files with the Scripting objects to move them.

    Hope this helps,

    W.
    When your car breaks down,
    close all windows and retry

    => please rate all users posts! <=

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Posts
    4
    Hey Thanks!
    But Is it possible to view the files being moved to the other directory ..for eg: in the fileOpen dialog box.

  4. #4
    Fanatic Member wildcat_2000's Avatar
    Join Date
    Nov 2000
    Location
    Italy
    Posts
    727
    Well just use filess(fsubm), which has the name of the file that you are treating...

    Sorry I don't have here the move code, hope you can manage.

    W.
    When your car breaks down,
    close all windows and retry

    => please rate all users posts! <=

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Posts
    4
    That's not a problem..Thanks.

Posting Permissions

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



Click Here to Expand Forum to Full Width