Results 1 to 3 of 3

Thread: Last time File was opened

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2005
    Posts
    537

    Last time File was opened

    How do I find the time that a file was last opened?

    Thanks,
    Sir Loin

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Last time File was opened

    The easy way is to use FSO (file system object model) but better way is to use Windows API.
    Here is a quick FSO sample:
    VB Code:
    1. Private Sub Command1_Click()
    2. '===============================
    3. Dim fso As New FileSystemObject
    4. Dim oFile As File
    5.  
    6.     Set fldr = fso.GetFolder("c:\temp")
    7.     Debug.Print "Last accessed: " & oFile.DateLastAccessed
    8.  
    9. End Sub

  3. #3
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926

    Re: Last time File was opened

    The last accessed date is not always the date it was last opened.
    If you look at the properties in explorer, the last accessed date is changed as well.

    Unless the file itselve registers when it was last opened, I don't think it can be done.
    Frans

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width