I have a simple form with a TextBox and a CommandButton.
I need to search the contents of all PPT files in a specific folder for the presence of whatever word is entered in the TextBox.
If the word exists within the first 4 slides of the PPT file(s) in question, the results are correct.
If the word exists in slides 5 through END, the results are wrong.
Dim homeDir, searchPhrase As String Dim searchCount As Integer searchPhrase = Me.txtSearchPhrase.Value homeDir = "C:\Temp\TestFolder" With Application.FileSearch .NewSearch .LookIn = homeDir .SearchSubFolders = False .TextOrProperty = searchPhrase & "*" .FileType = msoFileTypePowerPointPresentations If .Execute() > 0 Then searchCount = .FoundFiles.Count MsgBox "There were " & searchCount & " file(s) found." Else MsgBox "None" End If End With