Click here to Skip to main content
15,882,768 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralOT: DeleteFile and MoveFile in VBS Pin
stephan_00717-Apr-08 5:22
stephan_00717-Apr-08 5:22 
GeneralRe: OT: DeleteFile and MoveFile in VBS Pin
Dave Kreskowiak17-Apr-08 6:51
mveDave Kreskowiak17-Apr-08 6:51 
GeneralRe: OT: DeleteFile and MoveFile in VBS Pin
stephan_00717-Apr-08 8:24
stephan_00717-Apr-08 8:24 
GeneralRe: OT: DeleteFile and MoveFile in VBS Pin
Dave Kreskowiak17-Apr-08 8:37
mveDave Kreskowiak17-Apr-08 8:37 
GeneralRe: OT: DeleteFile and MoveFile in VBS Pin
stephan_00717-Apr-08 8:42
stephan_00717-Apr-08 8:42 
GeneralRe: OT: DeleteFile and MoveFile in VBS Pin
Ashfield17-Apr-08 9:00
Ashfield17-Apr-08 9:00 
GeneralRe: OT: DeleteFile and MoveFile in VBS Pin
stephan_00717-Apr-08 9:31
stephan_00717-Apr-08 9:31 
General"Can not create ActiveX Component" Pin
Harold_Wishes17-Apr-08 5:07
Harold_Wishes17-Apr-08 5:07 
Hello

I am testing a VB 2008 application which will allow the user to select a PDF, add a pre-defined annotation, and save the file back to disk. That's all I want from the program at the moment. However, I get a runtime error when I try to create the AcroExch.App object so that my application can interact with Acrobat. I get the "Can not create ActiveX Component" exception handler on the screen when I try to debug or launch my application. Does anyone know what this means?

I bolded the offending code below. Thanks! Smile | :)

Public Class Form1
    Dim gApp As Acrobat.CAcroApp
<p>
    Private Sub Form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        gApp = CreateObject("AcroExch.App")
    End Sub <p>


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim pdDoc As Acrobat.CAcroPDDoc
        Dim page As Acrobat.CAcroPDPage
        Dim jso As Object
        Dim path As String
        Dim point(1) As Integer
        Dim popupRect(3) As Integer
        Dim pageRect As Object
        Dim annot As Object
        Dim props As Object
<p>
        OpenFileDialog1.ShowDialog()
        path = OpenFileDialog1.FileName
<p>
        pdDoc = CreateObject("AcroExch.PDDoc")
<p>
        If pdDoc.Open(path) Then
            jso = pdDoc.GetJSObject
            If Not jso Is Nothing Then
                ' Get size for page 0 and setup arrays
                page = pdDoc.AcquirePage(0)
                pageRect = page.GetSize
                point(0) = 0
                point(1) = pageRect.y
                popupRect(0) = 0
                popupRect(1) = pageRect.y - 100
                popupRect(2) = 200
                popupRect(3) = pageRect.y
                ' Create a new text annot
                annot = jso.AddAnnot
                props = annot.getProps
                props.Type = "Text"
                annot.setProps(props)
                ' Fill in a few fields
                props = annot.getProps
                props.page = 0
                props.point = point
                props.popupRect = popupRect
                props.author = "Rob McAfee"
                props.noteIcon = "Comment"
                props.strokeColor = jso.Color.red
                props.Contents = "I added this comment from Visual Basic!"
                annot.setProps(props)
                pdDoc.Close()
                MsgBox("Annotation added to " & path)
            Else
                MsgBox("Failed to open " & path)
            End If
        End If
        pdDoc = Nothing
    End Sub
<p>

End Class</p></p></p></p></p></p>

GeneralRe: "Can not create ActiveX Component" Pin
Dave Kreskowiak17-Apr-08 5:11
mveDave Kreskowiak17-Apr-08 5:11 
GeneralRe: "Can not create ActiveX Component" Pin
Harold_Wishes17-Apr-08 5:22
Harold_Wishes17-Apr-08 5:22 
GeneralDatagrid Colour Based on the Records in the table Pin
Vimalsoft(Pty) Ltd17-Apr-08 3:29
professionalVimalsoft(Pty) Ltd17-Apr-08 3:29 
GeneralRe: Datagrid Colour Based on the Records in the table Pin
Dave Kreskowiak17-Apr-08 3:42
mveDave Kreskowiak17-Apr-08 3:42 
GeneralDatabase connection using Vb.net 2003 and MySQL 4.1 Pin
magesh2117-Apr-08 2:27
magesh2117-Apr-08 2:27 
GeneralRe: Database connection using Vb.net 2003 and MySQL 4.1 Pin
Dave Kreskowiak17-Apr-08 3:34
mveDave Kreskowiak17-Apr-08 3:34 
Generalcombo box invalid property array index Pin
kankeyan17-Apr-08 0:20
kankeyan17-Apr-08 0:20 
GeneralRe: combo box invalid property array index Pin
Luc Pattyn17-Apr-08 0:37
sitebuilderLuc Pattyn17-Apr-08 0:37 
GeneralRe: combo box invalid property array index Pin
kankeyan17-Apr-08 2:18
kankeyan17-Apr-08 2:18 
GeneralRe: combo box invalid property array index Pin
Luc Pattyn17-Apr-08 2:46
sitebuilderLuc Pattyn17-Apr-08 2:46 
QuestionSQL Timeout repeating a query Pin
Paul DAmbra16-Apr-08 22:51
Paul DAmbra16-Apr-08 22:51 
GeneralRe: SQL Timeout repeating a query Pin
Dave Kreskowiak17-Apr-08 3:30
mveDave Kreskowiak17-Apr-08 3:30 
GeneralRe: SQL Timeout repeating a query Pin
Vimalsoft(Pty) Ltd17-Apr-08 3:54
professionalVimalsoft(Pty) Ltd17-Apr-08 3:54 
Questionabout TableLayoutPanel control in vb.net 2.0 Pin
vijaylumar16-Apr-08 22:11
vijaylumar16-Apr-08 22:11 
GeneralRe: about TableLayoutPanel control in vb.net 2.0 Pin
Ajay.k_Singh17-Apr-08 1:10
Ajay.k_Singh17-Apr-08 1:10 
Question[Message Deleted] Pin
r_williams_8416-Apr-08 21:33
r_williams_8416-Apr-08 21:33 
GeneralRe: DLL Registration Pin
Dave Kreskowiak17-Apr-08 3:24
mveDave Kreskowiak17-Apr-08 3:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.