Was wondering if anyone can help with a rather simple task. I am trying to display a PDF file when the user clicks a command button from a simple VB 6.0 form. I have AcroRd32.dll version 7, but all the documentation I find is for version 4.0, which does not work. Was wondering if anyone knows how to use this version that comes with Acrobat 7.0, or if there is an easier way. I already spent 2 days "googling" this. I also tried FreeVBCode.com. The code they provided would not compile, so obviously I'm using the wrong DLL for their code. Very desperate to get this done, so thanks for any help.
Display a PDF from Visual Basic 6.0
Collapse
X
-
-
Originally posted by lorisigWas wondering if anyone can help with a rather simple task. I am trying to display a PDF file when the user clicks a command button from a simple VB 6.0 form. I have AcroRd32.dll version 7, but all the documentation I find is for version 4.0, which does not work. Was wondering if anyone knows how to use this version that comes with Acrobat 7.0, or if there is an easier way. I already spent 2 days "googling" this. I also tried FreeVBCode.com. The code they provided would not compile, so obviously I'm using the wrong DLL for their code. Very desperate to get this done, so thanks for any help. -
Sam,
Thank you so much! :) I knew it had to be easy, just couldn't find the right tool. I was trying to use a .DLL, because of the available documentation. My ocx is called AcroPDF.ocx and is in a different location than yours, but it works!!! Thanks again for this simple solution!Comment
-
Originally posted by SammyBAssuming that you have Adobe Reader, then you have pdf.ocx which is what you want to use. In VB6, right-click on the toolbox and select components. Browse to pdf.ocx (it was in Program Files\Adobe\Acr obat\Reader\Act iveX on my machine). That adds Acrobat Control for ActiveX, click OK. Add the control to your form and you're good to go. Use the LoadFile method to ,duh, load a file. It has problems: is not a full ActiveX control, but hopefully it will do what you want. --Sam
The AcroPDF does have problems. Once you end the VB application, the PDF closes but AcroRD32.exe is still running and occupying memory. After about 4 or 5 executions, you run out of memory. I have to run the task manager to end the AcroRd32.exe process. I read in other forums about this problem, but no solutions were posted. Can't have users running their task manager. The process should end when the VB app is closed. Can anyone help?Comment
Comment