View Full Version : File Details - Need correct syntax
bdsii
07-16-2009, 11:05 AM
I am trying to find a listing somewhere of the syntax for retrieving information on files in a folder.  I am using Vista and there are many details that could be available and be used if I knew how to access them to pull in the data to an excel spreadsheet.
 
I have found a few examples below but would like a comprehensive listing.  Since I am new to all this I am having difficulty even searching the web or on this forum for what I am looking for.  :dunno 
 
Can someone point me toward a listing of these ?  Thanks for any help you can provide!  :yes 
 
Examples I have so far:
Fil.Name 
Fil.DateLastAccessed 
Fil.DateLastModified 
Fil.DateCreated 
Fil.Type 
Fil.Size
Bob Phillips
07-16-2009, 11:28 AM
Look for
builtindocumentproperties
in VBA help
bdsii
07-16-2009, 12:10 PM
Thanks....I found the list but it does not appear I can use the names listed exactly in the fil.* statement.  For example, I don't think I can use the "fil.Creation Date" in my code.  Is there a way to know the proper syntax for using those names listed ?
 
Also, I noticed there are a lot of details available to view in the folders not listed.  Is that because you are not able to include them in the fil.* format to retrieve the data ?  Below are a few details showing in the folder that are not listed.  Are they examples of details that you cannot use in the "fil. " statement?  
Owner
Copyrite
Keywords
Bitrate
Protected
Genre
 
 
Any help is appreciated!
Bob Phillips
07-16-2009, 12:48 PM
What is fil?
bdsii
07-16-2009, 01:00 PM
I was referring to the statement in the code snippet below.  It is part of a macro that gets file details and returns them to an excel sheet.  The original code was developed by brettdj but they only used a few of the available details.  I was hoping to figure out how to call the other details that are available in a folder for a file.  I am not able to post a link to the code but it is in a KB article authored by brettdj.
 
X(i, 1) = oFolder.Path
        X(i, 2) = Fil.Name
        X(i, 3) = Fil.DateLastAccessed
        X(i, 4) = Fil.DateLastModified
        X(i, 5) = Fil.DateCreated
        X(i, 6) = Fil.Type
        X(i, 7) = Fil.Size
 
Any ideas how to use the other details in the "Fil. " statement  ?
Bob Phillips
07-16-2009, 02:02 PM
So presumably Fil is the file collection of a FilesystemObject folder? I suggest that you google Filesystemobject Folder properties then, that should throw you up a list.
mdmackillop
07-17-2009, 12:35 AM
I'm guessing these are media file types. BuiltIn DocumentProperties is basically an Office method.  I think you'll need to investigate the particular file type you are working with.  If you could provide the file type, perhaps someone here will know.
... I am not able to post a link to the code but it is in a KB article authored by brettdj.
 
 
X(i, 1) = oFolder.Path
X(i, 2) = Fil.Name
X(i, 3) = Fil.DateLastAccessed
X(i, 4) = Fil.DateLastModified
X(i, 5) = Fil.DateCreated
X(i, 6) = Fil.Type
X(i, 7) = Fil.Size
 
 
Any ideas how to use the other details in the "Fil. " statement ?
 
Hi bdsii,
 
I believe you can post a link after 5 posts, but could be wrong.  This appears to be from your other thread at:
http://www.vbaexpress.com/forum/showthread.php?t=27636
 
and brettdj's kb article was:
http://www.vbaexpress.com/forum/showthread.php?t=26569
 
Mark
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.