Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).

New Forum | Previous | Next | (P-PDF) Developers

Topic: VB to Acrobat Problems
Conf: (P-PDF) Developers, Msg: 136961
From: slapshot1079
Date: 7/29/2005 12:12 AM

Hello all:
I was going through the "Programming Acrobat JavaScript Using Visual Basic" and attempted one of the examples, but I cannot get it to work. I have .NET 2003 and Acrobat 7 (but I also have Acrobat 5 on my machine, so I'm not sure if that is why this is messing up...)

Here is the code (mostly copied from the "Programming..." manual into the VB):

Public Class Form1
Inherits System.Windows.Forms.Form
Dim gApp As Acrobat.CAcroApp
Dim gPDDoc As Acrobat.CAcroPDDoc
Dim jso As Object

' Prewritten section: " Windows Form Designer generated code "

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
gApp = CreateObject("AcroExch.App")
gPDDoc = CreateObject("AcroExch.PDDoc")
If gPDDoc.Open("c:\my documents\adobe.pdf") Then
jso = gPDDoc.GetJSObject
jso.console.println("Hello, Acrobat!")
End If
End Sub
End Class

I get the following error message:

An unhandled exception of type 'System.Exception' occurred in microsoft.visualbasic.dll
Additional information: Cannot create ActiveX component.

Is there some other reference that needs to be added (other that the Acrobat 7.0 Type Library) to make this go away, or is there a flaw in my code or how I pasted it in? I'm sure the code given is good - I suspect operator error :(

Any help would be appreciated..


PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Five visions of a PDF Day

In the world of PDFs or as we like to say Planet (of) PDF, a year isn't a real PDF year without an intense few days of industry knowledge sharing.

May 15, 2018
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.