Go Back   Access World Forums > Microsoft Access Reference > Sample Databases

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 07-03-2017, 12:59 PM   #1
ridders
AWF VIP
Gold Supporter
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 2,051
Thanks: 37
Thanked 483 Times in 448 Posts
ridders will become famous soon enough ridders will become famous soon enough
Obtaining extended file properties (attributes) using VBA

Recently, this thread 'Windows 10 Retrieving Extended File Properties' raised issues about using the GetDetailsOf method to retrieve extended file properties (attributes).

GetDetailsOf is a member of the VBA library 'Microsoft Shell Controls and Automation' based on Shell32.dll.

For anyone else who hasn't heard of this, each file includes several extended properties which can be retrieved as needed using this method.

For example:
Date created / date modified / date last accessed
File size / file type / author / location

Certain types of file will also contain additional extended properties including:
Height / width / horizontal resolution / vertical resolution / bit size (image files)
Contributing artist / album / year / genre / tile / track # / length / bit rate (audio files)

In all, there are a total of 311 extended properties though no files will ever use all of these

I decided to investigate this method further and have created a database which provides an easy way of obtaining and storing all the extended properties for an individual file or all files of a specified type in a selected folder.

The attached text files contain the full list of extended properties (attributes) & example output for an audio file

The zip file contains the database FileAttributes.accdb, a PDF file with full details and screenshots as well as several other text files with examples of the extended properties (attributes) obtained for different types of file

The database includes the VBA reference library 'Microsoft Shell Controls and Automation'

NOTE: it also includes an example of a dynamic crosstab query where the column headers are automatically updated to match the underlying data



Any questions or suggestions, please send me a private message or email me using the address given in the PDF file
Attached Images
File Type: png AttributesByFileType.PNG (65.5 KB, 752 views)
Attached Files
File Type: zip FileAttributes.zip (1.30 MB, 207 views)
File Type: txt FileAttributesList.txt (5.9 KB, 119 views)
File Type: txt MusicFileAttributes.txt (1.5 KB, 94 views)

__________________
Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
, Tapatalk


If this answer has helped, please click the Thanks button and/or click the 'reputation' scales symbol on the left and leave a comment. Cheers!

Last edited by ridders; 09-03-2017 at 02:32 PM. Reason: Modified text
ridders is offline   Reply With Quote
The Following 2 Users Say Thank You to ridders For This Useful Post:
DBQueen (07-13-2017), Gasman (08-02-2017)
Old 07-03-2017, 03:09 PM   #2
RuralGuy
AWF VIP
 
RuralGuy's Avatar
 
Join Date: Jul 2005
Location: @ 8300' in the Colorado Rockies
Posts: 13,717
Thanks: 5
Thanked 295 Times in 287 Posts
RuralGuy is just really nice RuralGuy is just really nice RuralGuy is just really nice RuralGuy is just really nice RuralGuy is just really nice
Re: Obtaining extended file properties (attributes) using VBA

Thanks Colin. Filed away for use later!
__________________
(RG for short) aka Allan Bunch Previous MS Access MVP acXP, ac07, ac10, ac13 - WinXP Pro, Win7 Pro, Win10 Pro
Please post back to this Forum so all may benefit.
Teaching is not filling a bucket but lighting a fire.

Last edited by RuralGuy; 07-04-2017 at 06:55 AM.
RuralGuy is offline   Reply With Quote
Old 08-02-2017, 06:41 AM   #3
jdraw
Super Moderator
 
jdraw's Avatar
 
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 10,726
Thanks: 36
Thanked 1,713 Times in 1,664 Posts
jdraw is just really nice jdraw is just really nice jdraw is just really nice jdraw is just really nice
Re: Obtaining extended file properties (attributes) using VBA

Colin,

Do you have a list of attributes for jpg?
Is there a link to some detailed info on attributes for jpg (I haven't found one)?

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
jdraw is offline   Reply With Quote
Old 08-02-2017, 07:10 AM   #4
ridders
AWF VIP
Gold Supporter
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 2,051
Thanks: 37
Thanked 483 Times in 448 Posts
ridders will become famous soon enough ridders will become famous soon enough
Re: Obtaining extended file properties (attributes) using VBA

I have now!
Just ran the FileAttributes.accdb on a random JPG file - see attached PDF
It only takes a few seconds to do.

Had to zip it as the file was unexpectedly large - its only a 1 page report

I've no idea where you can get details of JPG file type
Attached Files
File Type: zip JPGFileAttributes.zip (545.2 KB, 66 views)

__________________
Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
, Tapatalk


If this answer has helped, please click the Thanks button and/or click the 'reputation' scales symbol on the left and leave a comment. Cheers!
ridders is offline   Reply With Quote
Reply

Tags
attributes , extended file properties , getdetailsof , shell32.dll

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to Retrieve Extended File Properties Steve R. Modules & VBA 8 07-31-2017 01:26 AM
Windows 10 Retrieving Extended File Properties Mohsin Malik Modules & VBA 29 07-14-2017 01:50 AM
xml file attributes seen Word 1 11-05-2013 05:34 AM
File Extended Properties ezfriend General 3 03-30-2007 10:07 AM




All times are GMT -8. The time now is 08:43 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World