Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Feb 2001
    Location
    Virginia Beach, Virginia, USA
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ADv File Attributes (Office 2003)

    Anyway to programmatically get to the advanced file properties? I have a bunch of photos, and need to know the date/time they were taken (not modified). Any help would be appreciated.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ADv File Attributes (Office 2003)

    Microsoft has a DLL for (free) download that can get at Office document properties without opening the documents. It also works with other file types on Windows 2000 with NTFS, and I suppose that implies that it will also work on Windows XP and Windows Server 2003 with NTFS. I don't know if this applies to your situation.

    See Dsofile.exe Lets You Edit Office Document Properties from Visual Basic and ASP.

  3. #3
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: ADv File Attributes (Office 2003)

    You can also use the Scripting FileSystemObject to get certain file information. Example:

    Public Sub GetFileProperties(ByRef strFilePath As String)

    Dim fso As New Scripting.FileSystemObject
    Dim f As Scripting.File

    Set f = fso.GetFile(strFilePath)

    Debug.Print "Date Created: " & f.DateCreated
    Debug.Print "Date Last Modified: " & f.DateLastModified
    Debug.Print "Date Last Accessed: " & f.DateLastAccessed
    Debug.Print "Size: " & f.Size & " bytes"
    Debug.Print "Path: " & f.Path
    Debug.Print "Short Path: " & f.ShortPath

    Set fso = Nothing
    Set f = Nothing

    End Sub

    Example use with a .JPG file:

    GetFileProperties "Cocuments and SettingsMARK DMy DocumentsMy PicturesPhoto.jpg"
    Date Created: 7/30/2003 09:13:51 PM
    Date Last Modified: 7/30/2003 09:13:41 PM
    Date Last Accessed: 10/10/2003 04:19:00 AM
    Size: 16799 bytes
    Path: Cocuments and SettingsMARK DMy DocumentsMy PicturesPhoto.jpg
    Short Path: COCUME~1MARKD~1MYDOCU~1MYPICT~1Photo.jpg

    To be able to use FileSystemObject properties & methods, set a reference in your project to either Microsoft Scripting Runtime or Windows Script Host Object Model. The other option is to use the Windows API directly to get file information, but if all you need is Date Created, etc, using FSO is a lot simpler.

    HTH

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: ADv File Attributes (Office 2003)

    This is often referred to as EXIF information, and there's another acronym I can't remember (OSPF?). There are third party libraries available to access these attributes, including many open source projects at SourceForge in various stages of completion.

  5. #5
    Star Lounger
    Join Date
    Feb 2001
    Location
    Virginia Beach, Virginia, USA
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ADv File Attributes (Office 2003)

    Exif. Bingo. I was able to get the data needed. Now I just have to figure out why Windows won't show me it, when it would last week.
    thanks

Posting Permissions

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