Sign in to follow this  
Followers 0
nicero

Copy/paste from PDF to Excel userform

6 posts in this topic

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

Share this post


Link to post
Share on other sites



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 :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Pdfs are supposed to be locked, so make sure you arent plagiarising anything

secondly i suggest using a converter such as http://pdftoword.pro/

Then copy and paste text form you word doc.

Share this post


Link to post
Share on other sites

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

And include the UDFs in your code. More clean! too
 

openpath.$(au3)=$(autoit3dir)include;D:DokumenteAutoIt3UDF openpath.beta.$(au3)=$(autoit3dir)betainclude;D:DokumenteAutoIt3UDF


@IrishRover I know https://online-pdf.org does work quite well too. More specific options that you point too.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0