Jump to content

Copy/paste from PDF to Excel userform


Recommended Posts

I frequently copy some text from a PDF file and paste it inside some fields in a Excel userform.

I would like a software (AutoIt or others) that permits me to paste the selected text in the PDF to the correct Excel userform field. I was thinking about something that works like this:

1. I select/highlight some text in the PDF file

2. I press a combination of keys

3. the software pastes the text into the - let's say - 'title' field of the Excel userform

4. I select some other text in the PDF file

5. I press an other combination of keys

6. the software pastes the text in to the 'description' field of the Excel userform

I'm not an AutoIt guru. Can you post me some code please?

Thank you very much

Link to comment
Share on other sites

  • Moderators

Hi, nicero, welcome to the forum. This is a support forum; we try to adhere to the "teach a man to fish" method more than just providing code. If you're only looking to have someone write this for you, I would suggest vWorker. If you are interested in learning the AutoIt language, however, you will find a great amount of help here on the forum.

For your particular question, I would suggest looking in the Help file under a couple of subjects: HotKeySet, Send, ClipPut and ClipGet. I would think you could accomplish what you're looking to do in the following manner.

Highlight the text you want copied

Use a hotkey (defined by HotKeySet) to copy the text to the clipboard.

Highlight the field in your second file

Use another hotkey to obtain the text from the clipboard and paste into the file.

This is of course a very simple method to get you started, there are more complex ways that will streamline the process for you down the road. I would suggest reading through the help file, and try to code something like what I have below. If you run into questions, post what you have an we'll happily help :)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I frequently copy some text from a PDF file and paste it inside some fields in a Excel userform.

I would like a software (AutoIt or others) that permits me to paste the selected text in the PDF to the correct Excel userform field. I was thinking about something that works like this:

1. I select/highlight some text in the PDF file

2. I press a combination of keys

3. the software pastes the text into the - let's say - 'title' field of the Excel userform

4. I select some other text in the PDF file

5. I press an other combination of keys

6. the software pastes the text in to the 'description' field of the Excel userform

I'm not an AutoIt guru. Can you post me some code please?

Thank you very much

quick question - could the PDF be saved in a different format? For example Office 2010 may be able to save the file as an excel spreadsheet. If you can do that then it would be easy to use the excel.au3 commands to move the data.
Link to comment
Share on other sites

  • 1 year later...

If you can convert the PDF to Word then you could use the Word and Excel UDFs (User Defined Functions libraries) to automate your task.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • 11 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...