I found the following example which works great but I can't figure out how to return the page number the string was found on. Does anyone have any idea on how to do it?
HTML Code:
sub FindStr ()
Dim TextToFind As String
Dim PDFPath As String
Dim App As Object
Dim AVDoc As Object
'Initialize Acrobat by creating the App object.
Set App = CreateObject("AcroExch.App")
PDFPath = "C:\temp\test.pdf
'Initialize Acrobat by creating the App object.
Set App = CreateObject("AcroExch.App")
'Create the AVDoc object.
Set AVDoc = CreateObject("AcroExch.AVDoc")
'Open successful, bring the PDF document to the front.
AVDoc.BringToFront
'Search from 1st page: If true, the search begins on the first page of the document. If false, it begins on the current page (in this example is False).
If AVDoc.FindText(TextToFind, True, True, False) = False Then
'What I was hoping to find
debug.print avdoc.pagenumber
End If
end sub