+ Reply to Thread
Results 1 to 2 of 2

Import file size and file names from a directory

  1. #1
    Registered User
    Join Date
    02-07-2006
    Posts
    1

    Import file size and file names from a directory

    I have a lot of pdf files in a directory.
    I want to extract file names and file sizes in excel or access.
    Can you advise me any tool or code to do above task.
    Please also tell, If this can be done in Frontpage.

  2. #2
    Don Guillett
    Guest

    Re: Import file size and file names from a directory

    try
    Sub FindFiles()
    mypath = "c:\a"
    Application.Calculation = xlCalculationManual
    Application.ScreenUpdating = False
    With Application.FileSearch
    .NewSearch
    .LookIn = mypath
    .SearchSubFolders = True 'False
    .MatchTextExactly = False
    .filename = ".xls"
    If .Execute(msoSortOrderDescending) > 0 Then
    'MsgBox "There were " & .FoundFiles.Count & " file(s) found."
    For i = 1 To .FoundFiles.Count
    If Mid(.FoundFiles(i), Len(mypath) + 1, 2) <> " " Then
    Cells(i + lastrow, 1).Value = FileLen(.FoundFiles(i))
    'Cells(i + lastrow, 2).Value = FileDateTime(.FoundFiles(i))
    Cells(i + lastrow, 3).Value = Right(.FoundFiles(i), _
    Len(.FoundFiles(i)) - Len(mypath) - 1)
    End If
    Next i
    Else
    MsgBox "There were no files found."
    End If
    End With
    Application.ScreenUpdating = True
    Application.Calculation = xlCalculationAutomatic
    End Sub


    --
    Don Guillett
    SalesAid Software
    [email protected]
    "zahid" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have a lot of pdf files in a directory.
    > I want to extract file names and file sizes in excel or access.
    > Can you advise me any tool or code to do above task.
    > Please also tell, If this can be done in Frontpage.
    >
    >
    > --
    > zahid
    > ------------------------------------------------------------------------
    > zahid's Profile:
    > http://www.excelforum.com/member.php...o&userid=31250
    > View this thread: http://www.excelforum.com/showthread...hreadid=509238
    >




+ 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