Find files in directory with specified text content

RudySchneider

New Member
Joined
Oct 21, 2015
Messages
7
I tried to be as descriptive as possible with that title, and there may already exist a post that would help me, but...

1. I have a spreadsheet with many rows of wire harness numbers.
2. Going into Windows Explorer, I can navigate to a top-level directory and search for all the (Visio) files that contain that harness number.
3. I can then manually enter the file name(s) (or file number(s)) into a cell to the right of the harness of interest.
4. Repeat for next row (harness number).

Yeah, that works fine, but I've got a whole lotta harnesses for which I must search. Yes, I am capable of eventually writing my own VBA or macro to automate the above process, but with all the talent here, I'm hoping someone has had a similar challenge that he/she has already mastered, or a related post to which someone can direct me.

Thanks in advance --- Rudy
 
not with just VBA.. maybe there's an API, but I don't know of it. You're asking Excel to look in file contents.. Excel can open many files, but unless the program has a VBA Object Model, Excel VBA cannot interface with it - there's nothing there for it to latch onto. For example, Excel can open a Word document and look for specific words in that document because Excel can interact with Words object model. I don't know if that option is available with Visio.
The windows explorer can search the contents of a file.. but that's a property of Windows. So, there's probably an API that can be called from VBA. But which one - i have no idea.

maybe this will help: Download Visio IFilter 2003 Add-in: Text Search in Visio Files from Official Microsoft Download Center
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Thanks very much for your insight, Tracy! I was hoping something within FileSystemObject would allow me to search a Visio file. I'll look over your link.
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,946
Members
449,275
Latest member
jacob_mcbride

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top