Hi All!
As you may know I am Prabhakaran – an amateur in VBA programming. Currently I am aware of the object models of Word, Excel and Access (Ms-office tools only). Today I got a challenge to push my limits in programming. I have to read a pdf file to copy the contents of it and paste it in an ms-office application say excel. Generally programming the ms-office tools are called ‘Automation’. We just automate the process which is being done manually on those tools. Some Tools like word or excel even let the user to record their steps and generate and expose the respective code for the actions performed (Most people Learn(s)t in that way only). Until today I never know that one day I have to deal with pdf files. The day has come anyway. I confess I am a zero when comes to programming other than Ms-Office tools. I explored a little about this. I even believe I successfully set the reference for the Adobe Reader Object Library (Adobe Acrobat 9.0 Type Library). But other than ‘Adobe Acrobat 9.0 Type Library’ there are so many components have been listed with the word ‘Acrobat’ or ‘Acro’ in it. I also don’t know why it always says ‘Activex Component Can’t Create Object’ whenever I try to access the application after declaring it. Here is my code
Sub read_pdf( )
Dim myobj as new Acrobat.Acroapp
Myobj.show
End sub
This is my status on my practical attempt in automating the Adobe Reader. Only two steps, cannot improve further. Ok Lets speak about the things I searched on internet about this thing. I don’t know why it is this much difficult to find information on internet about automating the pdf files. After spending a considerable amount of time, this is all I can judge.
1. This thing is little bit heavier than I thought.
2. Not so many peoples are in need of this requirement.
3. So many peoples are suggesting javascript and internet explorer for this.
I also came to know that Adobe itself is giving an SDK regarding this. I am not yet sure that what is the actual purpose of the SDK. To me, I know what an SDK means. SDK – Software Development Kit. But why do they have to give an entire SDK if they already exposed some of the objects already. That means the SDK is for larger purpose and I believe that Object Model already supplied is enough to achieve the task I want. Just want to copy text and paste in msoffice tools. Anyway I tried it manually but there are so many formatting loss and Pictures are not coming. Anyway, Text only is enough now. But I welcome if someone shows me the ‘right way’ to automate everything regarding the Acrobat Reader application or about the pdf files Automation in general. Thanks in advance.