Problem to count WORD in PDF file with VBScript
Hi Colleagues!
Need to complete the script (test) which count how many times WORD appeared in PDF document.
I am using this script
Option Explicit
Dim accapp, acavdocu
Dim pdf_path, bReset, Wrd_count
pdf_path = "C:\Tips.pdf"
Set accapp = CreateObject( "AcroExch.App" )
accapp.Show()
Set acavdocu = CreateObject( "AcroExch.AVDoc" )
If acavdocu.Open( pdf_path, "" ) Then
acavdocu.BringToFront()
bReset = 1 : Wrd_count = 0
'FindText:Finds the specified text, scrolls so that it is visible, and highlights it
Do While acavdocu.FindText( "Primary", 1, 1, bReset )
bReset = 0 : Wrd_count = Wrd_count + 1
Wait 0, 200
Loop
End If
.....
the problem is that loop didn't finish. It count words on each page till the end (8 pages) and then started again,
Please tel me how can I count all word which I need and exit from the loop.
Thank you in advance
