Copy from PDF and pasting to text file without using Sendkeys()

pledbetter

Registered User.
Local time
Today, 07:09
Joined
Feb 20, 2012
Messages
16
I need to do the following:
1. Open up a PDF file using Acrobat Reader
2. Select all data
3. Copy all data
4. Close the PDF file
5. Open up a preexisting text file
6. Select all data
7. Paste my copied data
9. Save the text file
10. Close the text file

I can do steps 1, 5 just fine. The other steps work unreliably if at all using Sendkeys(). I need to know if there is another way to perform these steps wholly within the VBA environment without using SendKeys() or using a third-party application.

Thanks in advance!
 
  1. I don't know if Adobe Reader takes command line arguments, but as far as I recall there is a save as text option in the reader.
  2. There are free and not free PDF-readers out there (yes, the dreaded third-party applications) that can take command line parameters and can save as text, as Word or as Excel.
  3. For reading PDF's I use the free Pdftotext command line application (which is part of the open source XPDF suite) that I launch in a shell from VBA, and subsequently I read the produced textfile. See - no SendKeys :D
 

Users who are viewing this thread

Back
Top Bottom