Hi all,
I am trying to count the number of times a string exists in a pdf file. I used the below code, but it is going in infinite loop. The problem is after finding the string after the last page,it comes back to 1st page and repeats all the steps again. Does anyone have a solution for this problem. Any help will be appreciated.
Thanks siva
Dim AcroApp, AcroAVDoc
Dim gPDFPath, bReset, nCount
gPDFPath = "xyz.pdf"
Set AcroApp = CreateObject( "AcroExch.App" )
AcroApp.Show()
Set AcroAVDoc = CreateObject( "AcroExch.AVDoc" )
If AcroAVDoc.Open( gPDFPath, "" ) Then
AcroAVDoc.BringToFront()
bReset = True : nCount = 0
Do While AcroAVDoc.FindText( "let", True, True, bReset )
bReset = False : nCount = nCount + 1
Wait 0, 200
Loop
End If
AcroApp.CloseAllDocs()
AcroApp.Exit()