Copying data from multiple pdf files

后端 未结 6 1113
太阳男子
太阳男子 2021-01-14 19:51

I have pdf files from which I would like to copy all the data to a column in a spreadsheet.

Here is the code I have. All it does is open the pdf, use control-a, then

6条回答
  •  伪装坚强ぢ
    2021-01-14 20:20

    try this code this might work:

     Sub Shell_Copy_Paste()
    
       Dim o As Variant
       Dim wkSheet As Worksheet
    
       Set wkSheet = ActiveSheet
    
       o = Shell("C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe C:\Users\saurabh.ad.sharma\Desktop\red.pdf", vbNormalFocus)
    
       Application.Wait (Now + TimeSerial(0, 0, 2)) 'Wait for Acrobat to load
    
       SendKeys "^a"   'Select All
       SendKeys "^c"   'Copy
       SendKeys "%{F4}"    'Close shell application
    
       wkSheet.Range("B5").Select
       SendKeys "^v"   'Paste
    
    End Sub
    

提交回复
热议问题