473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Display a PDF from Visual Basic 6.0

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.
Apr 26 '07 #1
4 12496
SammyB
807 Expert 512MB
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.
Assuming 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\Acrobat\Reader\ActiveX 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
Apr 26 '07 #2
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!
Apr 27 '07 #3
Assuming 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\Acrobat\Reader\ActiveX 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?
Apr 28 '07 #4
Is it possible to specify the password with code in case of a password protected file ? Ofcourse given the fact we know the password .
Jun 3 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Corepaul | last post by:
I am a beginner, using Access 2000. I am having difficulty with the Visual Basic Help. Specifically, using the Index tab, when I enter "OpenRecordset" in the keyword field and click the Search...
0
by: John Olbert | last post by:
I have been given the task of finding ways to use legacy ActiveX controls in C# applications under Vs2005/Net2.0. At this time I am trying to use a number of ActiveX controls built with Visual...
0
by: adarsh1983rinku | last post by:
hi i m student of mca. i m making one project of student's database handeling in which. i want to enter the student information as well as his photograph. problem:- i don't want to scan...
4
by: Chris Asaipillai | last post by:
Hi there My compay has a number of Visual Basic 6 applications which are front endeed onto either SQL Server or Microsoft Access databases. Now we are in process of planning to re-write these...
2
by: swb76 | last post by:
I have a query in MSAccess and it is a select query. As i understand, any query run from Visual Basic would be returned in a recordset. Can i display the results to the user in a datasheet view?...
0
by: keithsimpson3973 | last post by:
Does anyone know if it is possible to display the value of a date picker control on a vb6 form that the user selected on an access report? I am using vb6 to display a report selection and it has a...
0
by: ranesmitas | last post by:
i want to use crystal report in visual basic as i am new , i want to know i create crytal report in visual basic . we want to create designer (crystal report) in visual basic or in seagate crystal...
1
by: vbsoft | last post by:
Hello My Name is Mike Am from Nigeria a student of computer Science, Pls i want your You to help in Using VISUAL BASIC 6.0 AND MS SQL SERVER AS DATABASE AS A CLIENT SERVER SIDE pLS: I...
3
by: firozfasilan | last post by:
I am new to visual basic 2008. In the past I have used vb6 to display an existing crystal report. I would like to accomplish the same with vb.net. However I am not clear on the syntax to display a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.