Results 1 to 2 of 2
  1. #1
    behnam is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2014
    Posts
    72

    How to get name of files in a folder

    Hi, Given a folder with a specific path, how can i get the name of the files in that folder and assign in to a string variable "Name". The plan is to go through every file in the folder one by one, and assign the name of the file to the "name" variable , and run some manipulations on it. Once the code for the manipulation is done, i will move forward. I tried the following but its not working




    Code:
    Dim fso As FileSystemObject
    Dim fold As Folder
    Dim f As File
    Dim folderPath As String
    Dim i As Integer
    folderPath = "\\2001T44P\206850$\SynchFolder\Desktop\aaa"
    Set fso = New FileSystemObject
    Set fold = fso.GetFolder(folderPath)
    For Each f In fold.Files
      MsgBox "a"
    Next
    just for a test but i get an error at Set fso = New FileSystemObject, thanks.

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Moving ALL Files in a Folder
    By JoeM in forum Programming
    Replies: 4
    Last Post: 04-19-2013, 01:59 PM
  2. Transfer all text files in a specified folder
    By rtackett in forum Programming
    Replies: 4
    Last Post: 09-10-2012, 11:50 AM
  3. Number of files in a folder.
    By Iain in forum Reports
    Replies: 3
    Last Post: 06-17-2012, 01:53 PM
  4. Replies: 13
    Last Post: 05-23-2012, 12:30 AM
  5. Copy files into specific folder
    By Jan22 in forum Access
    Replies: 12
    Last Post: 04-17-2012, 08:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums