These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

VB Application to Navigate PDF files

Georgestef
Registered: Oct 14 2007
Posts: 24

Dear AUC Expert, Using the examples in SDK 7.05 I was able to write a visual basic application that can open a PDF doc and navigate to a page number provided by the VB program. My problem now is that I have both Acrobat and Reader on my machine. The program I modified insists on running Acrobat. How can I get this program to open Reader instead of Acrobat? As far as I can tell from the SDK documentation, the program will work for either Acrobat or Reader. Can you help? I am using Acrobat 7.0.9 and writing the application in Visual Studio 2005 using Visual Basic.

My Product Information:
Reader 7.0.8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
If you manually open either program then the IAC will talk to which ever is open.

You can progamatically open either with the standard system library tools. In C++ I do this with "shellExecute". I think there is an easier way in VB, but I don't know what it is.

In fact, all the information about the Acrobat installations is in the Registry. Just search though it to find all the versions and variations of Acrobat installed. Then launch the one you want.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Georgestef
Registered: Oct 14 2007
Posts: 24
When I manually open Acrobat Reader 8.0 and then run my VB app, the program opens Reader but gives the following message: "There was an error opening this document. This file cannot be found."

After a time the debugger opens pointing to the line of code creating the AcroExch.app object with the message: "exception was unhandled" The detail view gives the following further explanation: "Cannot create ActiveX component."

This is odd because if I do the same operation without first opening Reader. It works fine and it finds the file I specify for it to open except that it opens in Acrobat rather than Reader.

Can you suggest or pass my question on to someone who might be able to answer my questions more specifically for VB? Also if I am just barking up the wrong tree trying to do this with the OLE applications in the SDK, what other options do I have, and are there any examples out there on how to do this?

I am very wary of mucking around with the Registry so that is not an option for me unless I have very specific instructions.

Thanks for your help.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Well, I'm mystified. I've done this many times and not had that particular problem. Are you on Vista? This could be the problem.

I hate to say this, but you might try using the DDE interface. This is an ancient Windows inter-app interface mechanism, long before OLE. But it's still supported and I know it works with Reader.

My only other suggestion is to ask on the other Acrobat Forums. There are three main ones, Adobe user to user forums, the Planet PDF forums, and the PDF Zone forums.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Georgestef
Registered: Oct 14 2007
Posts: 24
OK If I am to use DDE how do I get started. The example in the SDK, unfortunately, to me is about as clear as mud. I need an example that gives me some actual code to setting up DDE. Do I need to add references or controls? Maybe if I had something simple like opening a PDF file. Once I have that i might be able to get what else I need on my own. Can you help?
Georgestef
Registered: Oct 14 2007
Posts: 24
On e more thing in response to your comment. I am using XP professional, Visual studio 2005 running Visual basic, and am trying get the information I need form the SDK 7.05 documentation.