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 Sub