Jim DeMarco
Jdemarco at hshhp.org
Mon May 19 11:37:12 CDT 2003
I've got a reference to MSO 9. Go figure! Anyway I didn't get too far on this thread last time so don't sweat it. I normally use the Dir function to loop through a folder filtered or otherwise. Thanks, Jim DeMarco -----Original Message----- From: Charlotte Foust [mailto:cfoust at infostatsystems.com] Sent: Monday, May 19, 2003 12:17 PM To: accessd at databaseadvisors.com Subject: RE: [AccessD] Grab filenames In 97, you needed a reference to the Microsoft Office library before you could even get to FileSearch. In Office 2000 and later, it's part of VBA and you only need an Office reference if you're using some of the mso constants. Charlotte Foust -----Original Message----- From: Jim DeMarco [mailto:Jdemarco at hshhp.org] Sent: Monday, May 19, 2003 7:41 AM To: accessd at databaseadvisors.com Subject: RE: [AccessD] Grab filenames But it does work in A97 unless you try to set the filename property (at least on my box). Unless I'm getting access to that object from some other application I installed. If I loop through folder I can print all the file names. If I try to filter I crash. Thanks, Jim DeMarco Director of Product Development HealthSource/Hudson Health Plan -----Original Message----- From: Charlotte Foust [mailto:cfoust at infostatsystems.com] Sent: Monday, May 19, 2003 11:35 AM To: accessd at databaseadvisors.com Subject: RE: [AccessD] Grab filenames What version of Access are you using? It wasn't available in 97, but you did have access to the FileSystem object through VBA. Charlotte Foust -----Original Message----- From: Roz Clarke [mailto:roz.clarke at donnslaw.co.uk] Sent: Monday, May 19, 2003 7:25 AM To: 'accessd at databaseadvisors.com' Subject: RE: [AccessD] Grab filenames thanks Charlotte, this looks great. I had never heard of the filesearch object! learn something new every day :) Roz -----Original Message----- From: Charlotte Foust [mailto:cfoust at infostatsystems.com] Sent: 19 May 2003 16:03 To: accessd at databaseadvisors.com Subject: RE: [AccessD] Grab filenames I think you'd have to do it with a FileSearch and write the results of each FoundFiles item into the table. Here's a FileSearch sample. Sub SimpleSearch() 'Perform simple search using the FileSearch object,\. Dim varItem as Variant With Application.Filesearch .NewSearch .FileName = "*.ini" .LookIn = "C:\Windows" .Execute For Each varItem in .foundFiles Debug.print varItem Next varItem End With End Sub Charlotte Foust -----Original Message----- From: Roz Clarke [mailto:roz.clarke at donnslaw.co.uk] Sent: Monday, May 19, 2003 6:54 AM To: 'accessd at databaseadvisors.com' Subject: [AccessD] Grab filenames Hi all Does anyone have a code snippet for pulling file search results into Access? What I want is to pull the filename, path & size of all files of a given type on a particular drive, including those in subfolders, into a table. I need to do it *fast*!!! TIA Roz ************************************************************************ *********** "This electronic message is intended to be for the use only of the named recipient, and may contain information from Hudson Health Plan (HHP) that is confidential or privileged. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this message is strictly prohibited. If you have received this message in error or are not the named recipient, please notify us immediately, either by contacting the sender at the electronic mail address noted above or calling HHP at (914) 631-1611. If you are not the intended recipient, please do not forward this email to anyone, and delete and destroy all copies of this message. Thank You". ************************************************************************ *********** _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com *********************************************************************************** "This electronic message is intended to be for the use only of the named recipient, and may contain information from Hudson Health Plan (HHP) that is confidential or privileged. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this message is strictly prohibited. If you have received this message in error or are not the named recipient, please notify us immediately, either by contacting the sender at the electronic mail address noted above or calling HHP at (914) 631-1611. If you are not the intended recipient, please do not forward this email to anyone, and delete and destroy all copies of this message. Thank You". ***********************************************************************************