How to print a list of documents in folder

  • Thread starter Thread starter ERNIE ORNELLAS
  • Start date Start date
E

ERNIE ORNELLAS

I AM USING EXCEL TO MAINTAIN A PERMANENT LIST OF WORK
ORDER DOCUMENTS. I WANT TO TAKE MY NUMERICAL LIST OF
DOCUMENTS AS THEY APPEAR WHEN I OPEN THE FOLDER AND PRINT
THEM TO USE AS AN INDEX.

CAN ANYONE GIVE ME DIRECTION ON HOW TO ACCOMPLISH THIS
TASK?
 
Ernie,

Try this which lists the files, and create and modify dates

Sub SubGetMyData()

Dim objFSO As Object
Dim objFolder As Object
Dim objFile As Object
Dim iRow As Long

iRow = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("c:\MyTest\")
For Each objFile In objFolder.Files
Cells(iRow, 1).Value = objFile.Name
Cells(iRow, 2).Value = objFile.DateCreated
Cells(iRow, 3).Value = objFile.DateLastModified
iRow = iRow + 1
Next
End Sub
 

Ask a Question

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. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top