AW: Datei-Informationen auslesen
11.01.2007 11:32:30
Nepumuk
Hi,
versuch's mal so:
' **********************************************************************
' Modul: Modul2 Typ: Allgemeines Modul
' **********************************************************************
Option Explicit
Public Sub Dateieigenschaften()
'von K.Rola
Const STRFOLDER As String = "C:\Dokumente und Einstellungen\Max Kaffl\Eigene Dateien\Eigene eBooks"
Dim objShell As Object, objFolder As Object
Dim bytIndex As Byte, intColumn As Integer, lngRow As Long
Dim varName
If Dir(STRFOLDER, 16) = "" Then
MsgBox "Der Ordner " & STRFOLDER & " wurde nicht gefunden!", 64, "Hinweis"
Exit Sub
End If
Application.ScreenUpdating = False
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(STRFOLDER)
intColumn = 1
For bytIndex = 0 To 37
Cells(1, intColumn + bytIndex) = objFolder.GetDetailsOf(varName, bytIndex)
Next
Rows(1).Font.Bold = True
lngRow = 2
For Each varName In objFolder.Items
For bytIndex = 0 To 37
Cells(lngRow, intColumn + bytIndex) = objFolder.GetDetailsOf(varName, bytIndex)
Next
lngRow = lngRow + 1
Next
Columns.AutoFit
Application.ScreenUpdating = True
End Sub
Gruß
Nepumuk