Link to home
Start Free TrialLog in
Avatar of xbzhao
xbzhaoFlag for United States of America

asked on

SendKeys From Excel VBA to Acrobat

I have PDF file with interactive controls in it (textboxes and command buttons). I would like to fill in Acrobat textboxes with Data using Excel VBA. Is it possible?

I've tried using Sendkeys, but it didn't work. Here is my code:

Sub Test()

      Dim gApp As Acrobat.AcroApp
      Dim gPDDoc As Acrobat.AcroPDDoc



     Set gApp = CreateObject("AcroExch.app")
     Set gPDDoc = CreateObject("AcroExch.PDDoc")
     If gPDDoc.Open("C:\MyFile.pdf") Then
       
        gPDDoc.OpenAVDoc ("C:\MyFile.pdf")
       
        gApp.Show
       
        DoEvents
        Application.SendKeys "{TAB}", True
        DoEvents

End Sub                
     
   
       
ASKER CERTIFIED SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of xbzhao

ASKER

It didn't work. What did work is putting Application.wait before sending keys.