VBA/Excel/Access/Word/File Path/Folder — различия между версиями

Материал из VB Эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Текущая версия на 12:47, 26 мая 2010

Create folder

 
Sub cmdCreateFolder_Click()
    Dim myFileSystemObject As FileSystemObject
    Set myFileSystemObject = New FileSystemObject
    myFileSystemObject.CreateFolder ("c:\ttt")
End Sub



Folder information

 
Sub cmdFolderInfo_Click()
    Dim myFileSystemObject As FileSystemObject, curFolder As folder
    Set myFileSystemObject = New FileSystemObject
    Set curFolder = myFileSystemObject.GetFolder("c:\Java_Dev\")
    With curFolder
        Debug.Print "Created: " & .DateCreated & vbCrLf
        Debug.Print "Last Accessed: " & .DateLastAccessed & vbCrLf
        Debug.Print "Last Modified: " & .DateLastModified & vbCrLf
        Debug.Print "Size: " & Format(.Size / 1000#, "#0.00") & "KB"
    End With
    Set myFileSystemObject = Nothing
    Set curFolder = Nothing
End Sub