Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Is there any way to click OK using vba or javascript on a Acrobat dialog box?

New Here ,
May 30, 2019 May 30, 2019

Is there any way to click OK using vba or javascript on a Acrobat dialog box?

TOPICS
Acrobat SDK and JavaScript , Windows
894
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 30, 2019 May 30, 2019

Not possible with JavaScript, and I doubt it is with VBA.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 30, 2019 May 30, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 04, 2019 Jun 04, 2019
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines