Is there any way to click OK using vba or javascript on a Acrobat dialog box?
Copy link to clipboard
Copied
Is there any way to click OK using vba or javascript on a Acrobat dialog box?
Copy link to clipboard
Copied
Not possible with JavaScript, and I doubt it is with VBA.
Copy link to clipboard
Copied
I tried using vba sendkeys and it actually worked for a while. I'm not sure what happened. I can get the text recognition dialog to pop up using the following:
AcroApp.MenuItemExecute ("Cpt:CapturePages")
But it won't execute from there even though it did before. I hate to turn this over to the user since it is so simple. Executing this would save her a step.
Copy link to clipboard
Copied
This worked!
Public Function RecogText(strFilePath As String)
'**************THIS WORKS********************
'acroAppObj.MenuItemExecute ("Cpt:CapturePages")
Dim ItWorks As Boolean
Dim ctlCurrentControl As Control
Dim AcroApp As AcroApp
Dim PDDoc As AcroPDDoc
Set AcroApp = CreateObject("AcroExch.App")
Dim AVDoc As AcroAVDoc
Set AVDoc = CreateObject("AcroExch.AVDoc")
ItWorks = AVDoc.Open(strFilePath, TempName)
AcroApp.Show
Set PDDoc = CreateObject("AcroExch.PDDoc")
Set PDDoc = AVDoc.GetPDDoc
'****** SEND KEYSTROKES TO ACROBAT TO MANIPULATE OCR DIALOG BOX ******
'****** TABS take you to the 'ok' button and SendKeys sends 'ENTER' ******
SendKeys "{TAB 7}"
DoEvents
SendKeys "{ENTER}", True
AcroApp.MenuItemExecute ("Cpt:CapturePages")
PDDoc.Save 1, strFilePath
Set AcroApp = Nothing
End Function

