Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 03-29-2007, 12:16 PM   #1
ezfriend
Newly Registered User
 
ezfriend's Avatar
 
Join Date: Nov 2006
Posts: 242
Thanks: 0
Thanked 0 Times in 0 Posts
ezfriend is on a distinguished road
Smile File Extended Properties

I have a list of files which contain the full path of the file (dir & filename), how can I get the extended properties for these files?

I try to use the script

Dim arrHeaders(35)
dim sFolder as string

sfolder = "C:\Scripts"

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(sfolder ) 'objFolder = nothing even after the object is set.

It does work; however, if I were to hard-code the path in the NameSpace("c:\Scripts")


For i = 0 to 34
arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)
Next

For Each strFileName in objFolder.Items
For i = 0 to 34
msgbox objFolder.GetDetailsOf(strFileName, i)
Next
Next

Any thoughts on this?

Thanks.

ezfriend is offline   Reply With Quote
Old 03-29-2007, 03:04 PM   #2
dcobau
Registered User
 
Join Date: Feb 2004
Posts: 124
Thanks: 0
Thanked 0 Times in 0 Posts
dcobau is on a distinguished road
excuse my ignorance but what do you mean by extended properties?

Dave
dcobau is offline   Reply With Quote
Old 03-29-2007, 07:11 PM   #3
The_Doc_Man
AWF VIP
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 11,027
Thanks: 40
Thanked 910 Times in 822 Posts
The_Doc_Man is a name known to all The_Doc_Man is a name known to all The_Doc_Man is a name known to all The_Doc_Man is a name known to all The_Doc_Man is a name known to all The_Doc_Man is a name known to all
You can use the GetFile method of the file system object by doing a loop on the files implied in a GetFolder method. (Look these things up in Access help.)

Once you have a file selected via GetFile, the file object has properties you can examine.

Set {file-object} = GetFile( {file-spec} )

x = {file-object}.{property}

You can explore the Access Help files to determine the properties and methods available to you with regard to the file object. I don't know if you can explore custom-defined properties, though. The file system object is built mostlyfor "standard" files.

Once you have browsed the help on File System Objects, perhaps you can ask a more specific question.

__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
The_Doc_Man is offline   Reply With Quote
Old 03-30-2007, 10:07 AM   #4
MarkK
Super Moderator
 
MarkK's Avatar
 
Join Date: Mar 2004
Location: Vancouver BC
Posts: 7,293
Thanks: 9
Thanked 1,190 Times in 1,132 Posts
MarkK is a glorious beacon of light MarkK is a glorious beacon of light MarkK is a glorious beacon of light MarkK is a glorious beacon of light MarkK is a glorious beacon of light MarkK is a glorious beacon of light
Strangely, this seems to work...
Code:
Set objFolder = objShell.NameSpace(Eval("""" & sFolder & """"))

MarkK is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
txt file locked when excel opens it DataMiner Excel 0 10-06-2006 11:16 AM
Cache problem on web-based Excel file PearlGI Web Design and Development 0 08-17-2006 04:41 AM
Pausing for Batch runtime tfaiers Forms 3 08-09-2006 07:12 AM
Converting a File within Access gblack Modules & VBA 1 03-15-2006 01:35 PM




All times are GMT -8. The time now is 03:17 AM.


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 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World