isladogs
MVP / VIP
- Local time
- Today, 10:26
- Joined
- Jan 14, 2017
- Messages
- 18,563
Recently I was contacted by someone who had seen my example database on extended file properties
https://www.access-programmers.co.uk/forums/showthread.php?t=294548
They had a follow up question.
Is it possible to set properties for external files using Access VBA?
After a little bit of digging I found the answer is a partial YES.
1. You need to install the file dsofile.dll as a VBA reference library
2. Properties can be edited provided the extended property exists
3. New properties cannot be created AFAIK
NOTE:
I couldn’t find dsofile.dll on my system but downloaded it from
[url]https://www.microsoft.com/en-us/download/confirmation.aspx?id=8422 [/URL]
and copied it to c:\windows\system32 folder then registered it using regsvr32
I then added this as a VBA reference – its DSO OLE Document Properties Reader 2.1
So for example, using Access VBA, the Comments property can be written to for external docx & xlsx files
However I believe it can't be done for accdb or txt files which do not have this property.
MP3 files have lots of properties which can be written to
This appears to be different to internal database properties where new properties can of course be created
However I may be missing something obvious - hence this post
The attached database is very much work in progress.
I have included dsofile.dll (as an EXE file to install) and some sample files to play with
When a file is selected, the specified folder opens in form view
Right click to change to details view so the property values can be viewed
I would be grateful for any ideas to take this further .....
INCLUDING being able to open explorer directly in details view in a web browser window using VBA
https://www.access-programmers.co.uk/forums/showthread.php?t=294548
They had a follow up question.
Is it possible to set properties for external files using Access VBA?
After a little bit of digging I found the answer is a partial YES.
1. You need to install the file dsofile.dll as a VBA reference library
2. Properties can be edited provided the extended property exists
3. New properties cannot be created AFAIK
NOTE:
I couldn’t find dsofile.dll on my system but downloaded it from
[url]https://www.microsoft.com/en-us/download/confirmation.aspx?id=8422 [/URL]
and copied it to c:\windows\system32 folder then registered it using regsvr32
I then added this as a VBA reference – its DSO OLE Document Properties Reader 2.1
So for example, using Access VBA, the Comments property can be written to for external docx & xlsx files
However I believe it can't be done for accdb or txt files which do not have this property.
MP3 files have lots of properties which can be written to
This appears to be different to internal database properties where new properties can of course be created
However I may be missing something obvious - hence this post
The attached database is very much work in progress.
I have included dsofile.dll (as an EXE file to install) and some sample files to play with
When a file is selected, the specified folder opens in form view
Right click to change to details view so the property values can be viewed
I would be grateful for any ideas to take this further .....
INCLUDING being able to open explorer directly in details view in a web browser window using VBA