... du könntest mal folgendes ausprobieren:
Function FileLastModified( sFile As String ) As String
Dim fso As Variant
Dim fsoFile As Variant
Dim sLastModified As String
'
Set fso = CreateObject( "Scripting.FileSystemObject" )
If fso.FileExists( sFile ) Then
' Print "Die Datei existiert"
Set fsoFile = fso.GetFile( sFile )
sLastModified = fsoFile.DateLastModified
Set fsoFile = Nothing
Set fso = Nothing
Else
' Print "Die Datei existiert nicht"
sLastModified = ""
Set fso = Nothing
End If
'
FileLastModified = sLastModified
'
End Function
... sollte eventuell für jede Datei funktionieren - zuvor das Attachment lösen und dann mit der Funktion angrabben...
Toni
*** edit ***
... habe noch einen Fehler debuggt...
Toni
... ich habe den Code soeben getestet und festgestellt, daß er - verständlicherweise - einen Leerstring zurückliefert, wenn die Datei seit ihrer Erstellung noch nie verändert wurde, daher habe ich die Funktion um das Erstellungsdatum erweitert:
Function FileLastModified( sFile As String ) As String
Dim fso As Variant
Dim fsoFile As Variant
Dim sLastModified As String
'
Set fso = CreateObject( "Scripting.FileSystemObject" )
If fso.FileExists( sFile ) Then
Set fsoFile = fso.GetFile( sFile )
sLastModified = fsoFile.DateLastModified
'
If sLastModified = "" Then sLastModified = fsoFile.DateCreated
'
Set fsoFile = Nothing
Set fso = Nothing
Else
sLastModified = ""
Set fso = Nothing
End If
FileLastModified = sLastModified
End Function
Toni