ajliaks


Hi guys,
The code below makes an excel spreadsheet wich retrieves the names and details of the files contained into a specific folder.
Does anyone knows how to get name (author) of the file
Thanks in advance,
Aldo.
Function GetListOfFilesInspecifiedFolder()
Dim oFSO As Object, Folder As Object, File As Object
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set Folder = oFSO.GetFolder(BaseDirectory)
'Reads the name of each file
RowNr = 3
For Each File In Folder.Files
Cells(RowNr, 6).Value = Format(File.DateCreated, "dd/mm/yyyy")
Cells(RowNr, 7).Value = Format(File.DateLastModified, "dd/mm/yyyy")
Cells(RowNr, 8).Value = Format(File.DateLastAccessed, "dd/mm/yyyy")
Cells(RowNr, 8).Value = File.Author ERROR!!!!
Next File
Set oFSO = Nothing
Set Folder = Nothing
End Function




Re: Vba Excel - Get Workbook Author

Shasur


If you are extracting details of Excel Workbooks alone you can use

ActiveWorkbook.BuiltinDocumentProperties("Author").Value

If you are getting for all types of files try with DSOFile.dll . Here you can extract both Custom & Summary Properties

Cheers

Shasur







Re: Vba Excel - Get Workbook Author

ajliaks

Hi Shasur, I need details of all kind of files.

Can you give me an example of how should I use DSO File.dll

Thanks,

Aldo.







Re: Vba Excel - Get Workbook Author

Shasur

Here you have

http://support.microsoft.com/kb/224351

You can get a sample VB Project there.

Extraction of data is fast using DSOFile

Good luck

Cheers

Shasur