VBA/Excel/Access/Word/File Path/FileDateTime — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 16:33, 26 мая 2010
Содержание
Displaying a list of files in a directory
Sub ListFiles2()
With Application.fileSearch
.NewSearch
.LookIn = "c:\windows\desktop\"
.FileName = "*.*"
.SearchSubFolders = False
.Execute
For i = 1 To .FoundFiles.Count
Debug.Print .FoundFiles(i)
Debug.Print FileLen(.FoundFiles(i))
Debug.Print FileDateTime(.FoundFiles(i))
Next i
End With
End Sub
FormatDateTime(Now, vbGeneralDate)
Sub dateFunctions()
Debug.Print "vbGeneralDate: " & FormatDateTime(Now, vbGeneralDate)
End Sub
FormatDateTime(Now, vbLongDate)
Sub dateFunctions()
Debug.Print "vbLongDate: " & FormatDateTime(Now, vbLongDate)
End Sub
FormatDateTime(Now, vbShortDate)
Sub dateFunctions()
Debug.Print "vbShortDate: " & FormatDateTime(Now, vbShortDate)
End Sub
Retrieve Date and Time of Last Save
Sub LastSaved()
Debug.Print FileDateTime("C:\")
End Function