Showing Search results in msgbox?

  • Thread starter Thread starter Ed
  • Start date Start date
E

Ed

I have links to a batch of Word files in my spreadsheet. I'm trying to
create a macro that will let my users use the Open>Tools>Find search
function to search all the files for documents containing certain words or
phrases. My only problem is that I can't figure out how to save the search
results in a string to show in a message box when the search is complete.
(There's reasons why I would prefer to do the message box rather than giving
them the Open Files window, if it's possible.)

Any suggestions are appreciated.
Ed
 
Thank you, Tom!

Ed

Tom Ogilvy said:
Use the filesearch object.

this returns .FoundFiles

you can then do

for i = 1 to .Foundfiles.count
msgbox .foundFiles(i)
Next

There is a good code example in the Excel VBA help files.
 
Back
Top