Import file summary and custom properties to excel or access

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
DumbTekDame
Newbie
Posts: 4
Joined: Tue Apr 11, 2006 6:20 am

Import file summary and custom properties to excel or access

Post by DumbTekDame » Tue Apr 11, 2006 6:26 am

i have a lot of documents that we want to manage by importing the file properties to excel and then, managing through access. the files are all based on microsoft office products and I don't want to open them all, i want to create a batchfile.

I want to arrange the data in a table array. help!

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Tue Apr 11, 2006 6:32 pm

This might get you started,

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("c:\windows\system32\scrrun.dll")
Wscript.Echo "Date created: " & objFile.DateCreated
Wscript.Echo "Date last accessed: " & objFile.DateLastAccessed
Wscript.Echo "Date last modified: " & objFile.DateLastModified
Wscript.Echo "Drive: " & objFile.Drive
Wscript.Echo "Name: " & objFile.Name
Wscript.Echo "Parent folder: " & objFile.ParentFolder
Wscript.Echo "Path: " & objFile.Path
Wscript.Echo "Short name: " & objFile.ShortName
Wscript.Echo "Short path: " & objFile.ShortPath
Wscript.Echo "Size: " & objFile.Size
Wscript.Echo "Type: " & objFile.Type

This code will only show these attributes back to your screen and, of course, you'll need to call it from MacroScheduler with something like:

VBEval>GetFileProperties (%CreateDate%,%AccessDate%,%ModDate%, etc.....)

one 'place holder' for each property you would like to record.

When you get these back into MacroScheduler, just use DDEPoke to send them to Excel.

This would be an interesting project. What are you trying to accomplish with this? Other than just "managing with Access"....

SkunkWorks

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Tue Apr 11, 2006 6:47 pm

Here is a great link for VBScript to work with the FileObjects.

http://www.activexperts.com/activmonito ... eProps.htm

DumbTekDame
Newbie
Posts: 4
Joined: Tue Apr 11, 2006 6:20 am

Retrieving Multiple File Properties from 1 Folder

Post by DumbTekDame » Wed Apr 12, 2006 4:04 am

thanks for the vba. i'm trying to obtain multiple file properties from multiple documents from a folder. the vba code seems to retrieve just the 1.

Also do I put a "sub" in front to run the code as a macro?

DumbTekDame
Newbie
Posts: 4
Joined: Tue Apr 11, 2006 6:20 am

file properties use

Post by DumbTekDame » Wed Apr 12, 2006 4:09 am

I'm not a network monitor. I'm trying to collate a database and also, change multiple file properties without opening the files.

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Wed Apr 12, 2006 4:09 am

I'd like to put together some code to do multiple files for you. I'm a little pressed for time, but will stay at it. I'm thinking of using GetFileList> then passing the filenames to the VBScript, retrieving the properties, then writing them to Excel (or directly to Access if you'd rather).

I have a little "airport time" tomorrow, stay tuned....

SkunkWorks

DumbTekDame
Newbie
Posts: 4
Joined: Tue Apr 11, 2006 6:20 am

thanks SkunkWorks! will stay tuned!

Post by DumbTekDame » Wed Apr 12, 2006 4:11 am

thanks SkunkWorks! will stay tuned!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts