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?
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:
Private Sub displayFileInfo(ByVal fileName As String)
Dim fso As New FileSystemObject
Dim fileSpec As File
Dim strInfo As String
Set fileSpec = fso.GetFile(fileName)
strInfo = fileSpec.Name & vbCrLf
strInfo = strInfo & "Created: "
strInfo = strInfo & fileSpec.DateCreated & vbCrLf
strInfo = strInfo & "Last Accessed: "
strInfo = strInfo & fileSpec.DateLastAccessed & vbCrLf
strInfo = strInfo & "Last Modified: "
strInfo = strInfo & fileSpec.DateLastModified
MsgBox strInfo, vbInformation, "File Information"
Set fileSpec = Nothing
End Sub
Is this for any type of file, or do you have a specific file type in mind?
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:
Private Sub displayFileInfo(ByVal fileName As String)
Dim fso As New FileSystemObject
Dim fileSpec As File
Dim strInfo As String
Set fileSpec = fso.GetFile(fileName)
strInfo = fileSpec.Name & vbCrLf
strInfo = strInfo & "Created: "
strInfo = strInfo & fileSpec.DateCreated & vbCrLf
strInfo = strInfo & "Last Accessed: "
strInfo = strInfo & fileSpec.DateLastAccessed & vbCrLf
strInfo = strInfo & "Last Modified: "
strInfo = strInfo & fileSpec.DateLastModified
MsgBox strInfo, vbInformation, "File Information"
Set fileSpec = Nothing
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.
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?
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
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...
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)
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
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
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.
:confused: 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?
Re: Summary Properties of a file
Sama, its usually best to create a new thread and link back to thread or post in question. ;)
Re: Summary Properties of a file
Hi,
I am refering to the code
VB Code:
Private Sub displayFileInfo(ByVal fileName As String)
Dim fso As New FileSystemObject
Dim fileSpec As File
Dim strInfo As String
Set fileSpec = fso.GetFile(fileName)
strInfo = fileSpec.Name & vbCrLf
strInfo = strInfo & "Created: "
strInfo = strInfo & fileSpec.DateCreated & vbCrLf
strInfo = strInfo & "Last Accessed: "
strInfo = strInfo & fileSpec.DateLastAccessed & vbCrLf
strInfo = strInfo & "Last Modified: "
strInfo = strInfo & fileSpec.DateLastModified
MsgBox strInfo, vbInformation, "File Information"
Set fileSpec = Nothing
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.
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.