LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 186
Default using application.filesearch for searching text in PDF

I would use application.filesearch in a excel macro
for searching the body text of PDF files, it works with office files but not
with pdf.

Any possible solution or alternatives to filesearch?
Below my code

Private Sub CommandButton1_Click()
Dim files As Variant
Dim name As Variant
Set fs = CreateObject("Scripting.FileSystemObject")
Cells.ClearContents
With Application.FileSearch
.NewSearch
.LookIn = (UserForm1.TextBox1)
.SearchSubFolders = True
.TextOrProperty = (UserForm1.TextBox2)
.FileType = msoFileTypeAllFiles
If .Execute() 0 Then
Cells(1, 1) = "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
files = .FoundFiles(i)
name = fs.getfilename(files)
Cells(i + 2, 1).Hyperlinks.Add Anchor:=Cells(i + 2, 1),
Address:=files, TextToDisplay:=name
Next i
Else
Cells(1, 1) = "There were no files found."
End If
End With

Thank you in advance

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.FileSearch Cleberton(Brazilian) Excel Discussion (Misc queries) 2 October 26th 09 01:21 PM
opening and searching files in filesearch Mark[_66_] Excel Programming 1 April 16th 08 07:47 PM
Set fs = Application.FileSearch [email protected] Excel Programming 4 April 15th 08 10:17 PM
What is better: Application.FileSearch or Dir ?? WhytheQ Excel Programming 9 October 25th 06 01:29 PM
VBA Application.FileSearch Roger Frye Excel Programming 0 March 5th 04 04:07 AM


All times are GMT +1. The time now is 11:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"