Visual Basic for Applications Reference

Visual Studio 6.0

File Object

See Also    Example    Properties    Methods    Events    Specifics


Provides access to all the properties of a file.


The following code illustrates how to obtain a File object and how to view one of its properties.

Sub ShowFileInfo(filespec)
    Dim fs, f, s
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFile(filespec)
    s = f.DateCreated
    MsgBox s
End Sub