Results 1 to 13 of 13

Thread: Summary Properties of a file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Question Summary Properties of a file

    I am trying to get the summary properties of a file. Such as Title, Artist ect....

    I have been searcign the forum for the answer but i am not having any luck.
    I did however find this thread.

    http://vbforums.com/showthread.php?...file+properties

    it shows how to open the dialog box to view the summary info and the properties of a file. I am trying to get the summary info from that file and display it in text boxes for each individual summary info. Can anyone give me any input as to how i can retrieve this info?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Summary Properties of a file

    The File System Object will display many of the properties of a file. To use the FSO, you need to set the appropriate reference.

    Click Project/References

    Find: Microsoft Scripting RunTime Library

    Click the check box next to it, then click OK. Here is a sample:
    VB Code:
    1. Private Sub displayFileInfo(ByVal fileName As String)
    2.      Dim fso As New FileSystemObject
    3.      Dim fileSpec As File
    4.      Dim strInfo As String
    5.      Set fileSpec = fso.GetFile(fileName)
    6.      strInfo = fileSpec.Name & vbCrLf
    7.      strInfo = strInfo & "Created: "
    8.      strInfo = strInfo & fileSpec.DateCreated & vbCrLf
    9.      strInfo = strInfo & "Last Accessed: "
    10.      strInfo = strInfo & fileSpec.DateLastAccessed & vbCrLf
    11.      strInfo = strInfo & "Last Modified: "
    12.      strInfo = strInfo & fileSpec.DateLastModified
    13.      MsgBox strInfo, vbInformation, "File Information"
    14.      Set fileSpec = Nothing
    15. End Sub
    Is this for any type of file, or do you have a specific file type in mind?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Re: Summary Properties of a file

    Quote Originally Posted by Hack
    The File System Object will display many of the properties of a file. To use the FSO, you need to set the appropriate reference.

    Click Project/References

    Find: Microsoft Scripting RunTime Library

    Click the check box next to it, then click OK. Here is a sample:
    VB Code:
    1. Private Sub displayFileInfo(ByVal fileName As String)
    2.      Dim fso As New FileSystemObject
    3.      Dim fileSpec As File
    4.      Dim strInfo As String
    5.      Set fileSpec = fso.GetFile(fileName)
    6.      strInfo = fileSpec.Name & vbCrLf
    7.      strInfo = strInfo & "Created: "
    8.      strInfo = strInfo & fileSpec.DateCreated & vbCrLf
    9.      strInfo = strInfo & "Last Accessed: "
    10.      strInfo = strInfo & fileSpec.DateLastAccessed & vbCrLf
    11.      strInfo = strInfo & "Last Modified: "
    12.      strInfo = strInfo & fileSpec.DateLastModified
    13.      MsgBox strInfo, vbInformation, "File Information"
    14.      Set fileSpec = Nothing
    15. End Sub
    Is this for any type of file, or do you have a specific file type in mind?


    I have already been able to access the main properties from a file. What i want is to be able to get the summary info.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Summary Properties of a file

    Is this for any kind of file?

    You mentioned 'Title' 'Artisit'

    Are you after information on MP3 files only?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Re: Summary Properties of a file

    Quote Originally Posted by Hack
    Is this for any kind of file?

    You mentioned 'Title' 'Artisit'

    Are you after information on MP3 files only?

    Sorry. Yes it is for any kind of file. Specifically video files.
    AVI/MPG/WMV

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Dec 2004
    Posts
    129

    Re: Summary Properties of a file

    Someone has to knwo how to get the summary info of a file. It has to be possible if it shows up in windows explorer...

  7. #7
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049

    Re: Summary Properties of a file

    Ehh there is no easy way to get the data...

    For MP3's - Read the ID tag
    For AVI/MPG - Read the Metatag which has your info.
    For WMV - Dito as MPG..

    Windows does this just on the fly (also with JPG's etc reading the Exif data)

  8. #8
    New Member
    Join Date
    Mar 2006
    Posts
    7

    Re: Summary Properties of a file

    Hi,
    could i get the complete code for this?
    I am not able to use the code given by you.
    Please help

  9. #9
    New Member
    Join Date
    Mar 2006
    Posts
    7

    Re: Summary Properties of a file

    Hi,
    I am able to use your code.
    But it doent give any title , author as specified in your comment.
    Could you help me in getting those parameters.

    Regards,
    Sama

  10. #10
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Summary Properties of a file

    Quote Originally Posted by samasavinirs
    I am not able to use the code given by you.
    Quote Originally Posted by samasavinirs
    I am able to use your code.
    What code are you referring to? What I posted? (7 months ago)

    What are you trying to do? The same thing as the original posting member?

    Can you use the code or no?

  11. #11
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Summary Properties of a file

    Sama, its usually best to create a new thread and link back to thread or post in question.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  12. #12
    New Member
    Join Date
    Mar 2006
    Posts
    7

    Re: Summary Properties of a file

    Hi,
    I am refering to the code
    VB Code:
    1. Private Sub displayFileInfo(ByVal fileName As String)
    2.      Dim fso As New FileSystemObject
    3.      Dim fileSpec As File
    4.      Dim strInfo As String
    5.      Set fileSpec = fso.GetFile(fileName)
    6.      strInfo = fileSpec.Name & vbCrLf
    7.      strInfo = strInfo & "Created: "
    8.      strInfo = strInfo & fileSpec.DateCreated & vbCrLf
    9.      strInfo = strInfo & "Last Accessed: "
    10.      strInfo = strInfo & fileSpec.DateLastAccessed & vbCrLf
    11.      strInfo = strInfo & "Last Modified: "
    12.      strInfo = strInfo & fileSpec.DateLastModified
    13.      MsgBox strInfo, vbInformation, "File Information"
    14.      Set fileSpec = Nothing
    15. End Sub
    this doesnt give details like author etc. I need to get the extended properties of a video file.
    Could you help me with this.
    Last edited by Hack; Mar 7th, 2006 at 08:36 AM. Reason: Added [vbcode] [/vbcode] tags and for more clarity.

  13. #13
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Summary Properties of a file

    I dont think you can get those with the FileSystemObject. You probably need to open the file using some APIs to read the header of the video file.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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