• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Adobe PDF display in Userform and copy file contents to a worksheet

inddon

Member
Hello There,

I am looking to do the following:
1. Create a Userform:
-add a Userform ListBox item: where it would populate all pdf files from a given directory
-add a Userform PDF display item: Next to the Listbox, display the content of the PDF file
2. On click of a listbox row, display the PDF file
2. On Button Click: copy all the contents of the displayed PDF file
3. Paste it in a worksheet

My environment is as follows:Using VBA Editor, I enabled the below References:Added the Additonal Control:
-Adobe Reader DC
-Windows 10
-MS Excel 2016, 32 bit
-Adobe Acrobat Browser Control Type Library 1.0
-Acrobat Access3.0 Type Library
-AcroBrokerLib
-Adobe Acrobat DC Browser Control Implementation
-Adobe PDF Reader


In the Userform, when I click on the Toolbox - pdf control it gives an error "Element not found" (attached actial screenshot of the rror and reference & controls):
70886


I have attached the sample workbook for your reference.

Could you please guide as how this can be achieved using VBA with the actual code and which references are needed?

Thank you & regards,
Don
 

Attachments

  • Sample PDF Workbook.xlsm
    27.7 KB · Views: 23
Hello There,

After searching through the web, I came across a workaround using Webrowser item to display the pdf file

Code:
Private Sub UserForm_Initialize()
     WebBrowser1.Navigate "e:\abc.pdf"
End Sub


Now, I am looking for how:
1. the entire content displayed in this Webbrowser1 (pdf file) item can be copied and pasted in the worksheet


Look forward to hearing from you

Regards,
Don
 
Back
Top