Hi Everyone:
I need some help. I have the following to find some specific text on a pdf. It works fine. I want get the value just below the text found. On PDF I have a table and top row is the heading and next row is a value. I want to search the text (heading) and bring the value just below the heading. Any help will be really appreciated. Thanks
Macb
I need some help. I have the following to find some specific text on a pdf. It works fine. I want get the value just below the text found. On PDF I have a table and top row is the heading and next row is a value. I want to search the text (heading) and bring the value just below the heading. Any help will be really appreciated. Thanks
Code:
Sub PDFyo()
Dim gAvDoc As Acrobat.AcroAVDoc
Dim a As Acrobat.AcroPDTextSelect
Dim gPDFPath As String
Dim foundText As Integer
Dim Rsp
gPDFPath = "N:\ABC.pdf" '"C:\......" ' FILL IN PATH TO YOUR PDF HERE
Set gAvDoc = CreateObject("AcroExch.AVDoc")
If gAvDoc.Open(gPDFPath, "") Then
sText = "BM"
foundText = gAvDoc.FindText(sText, 1, 0, 1) 'Returns -1 if found, 0 otherwise
Else
Rsp = MsgBox("Cannot open" & gPDFPath, vbOKOnly)
End If
If foundText = -1 Then
sStr = "Found " & sText
resp = MsgBox(sStr, vbOKOnly)
End If
End Sub
Macb
Last edited: