|
-
Aug 18th, 2005, 01:02 PM
#1
Thread Starter
Addicted Member
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?
-
Aug 18th, 2005, 01:12 PM
#2
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?
-
Aug 18th, 2005, 01:27 PM
#3
Thread Starter
Addicted Member
Re: Summary Properties of a file
 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.
-
Aug 18th, 2005, 01:48 PM
#4
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?
-
Aug 18th, 2005, 02:03 PM
#5
Thread Starter
Addicted Member
Re: Summary Properties of a file
 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
-
Aug 23rd, 2005, 12:18 AM
#6
Thread Starter
Addicted Member
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...
-
Aug 23rd, 2005, 01:25 AM
#7
Frenzied Member
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)
-
Mar 7th, 2006, 05:33 AM
#8
New Member
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
-
Mar 7th, 2006, 05:44 AM
#9
New Member
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
-
Mar 7th, 2006, 07:20 AM
#10
Re: Summary Properties of a file
 Originally Posted by samasavinirs
I am not able to use the code given by you.
 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?
-
Mar 7th, 2006, 07:36 AM
#11
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Mar 7th, 2006, 08:15 AM
#12
New Member
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.
Last edited by Hack; Mar 7th, 2006 at 08:36 AM.
Reason: Added [vbcode] [/vbcode] tags and for more clarity.
-
Mar 7th, 2006, 08:22 AM
#13
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|