PDA

Click to See Complete Forum and Search --> : opening acad and acrobat


Suraj
Aug 11th, 2004, 10:26 AM
hi,

i need to know the vb code for opening acad and acrobat files - the following code which i used gives me errors/nothing happens.

Dim EAcad As New AutoCAD.AcadApplication
Dim eAdoc As New AutoCAD.AcadDocument
Set eAdoc = GetObject(filepath)
Set EAcad = eAdoc.Application

and

Dim adb As Acrobat.CAcroAVDoc
adb.Open szFullPath:=filename, szTempTitle:=filename
adb.FindText Text2.Text, 0, 0, 0

thanks.

Suraj
Aug 11th, 2004, 10:30 AM
i have referenced acrobat and acad tlb and dll files in the project references - so that is not a problem

RobDog888
Aug 11th, 2004, 11:00 AM
Dont you need to create the instance of acrobat too?
Set adb = New Acrobat.CAcroAVDoc

Suraj
Aug 11th, 2004, 11:47 AM
that did not work...

do u know some website where i could lookup about opening autocad and acrobat files in vb

thanks

RobDog888
Aug 11th, 2004, 11:13 PM
I know you can sign up for a membership with Adobe for free, but
its limited unless you want to upgrade to the full featured one for
some $$. They have samples and a SDK for Acrobat. I have used
it but on the Acrobat end and a little on the vb end. Check out
Adobe's site for Acrobat. My own basic code. Cant verify anymore
because I dont have Acrobat installed on my new system.
Option Explicit
'Add reference to acrobat 5.0
'Add one command button
'Add one commondialog control
Dim oApp As Acrobat.CAcroApp

Private Sub Form_Load()
Set oApp = CreateObject("AcroExch.App")
End Sub

Private Sub Form_Unload(Cancel As Integer)
If Not oApp Is Nothing Then
oApp.Exit
End If
Set oApp = Nothing
End Sub

Private Sub Command1_Click()

Dim pdfDoc As Acrobat.CAcroPDDoc
Dim sPath As String

'Path to an existing pdf document
CommonDialog1.ShowOpen
sPath = CommonDialog1.FileName
Set pdfDoc = CreateObject("AcroExch.PDDoc")
If pdfDoc.Open(sPath) Then
'...
Else
'...
Endif

End SubHTH