VB 6.0 - How to open PDF files using Acrobat.AcroPDDoc

Asked By bhanu priya on 04-Feb-10 06:27 AM

Dim adAcrobatApp As New Acrobat.AcroPDDoc

Dim adAcrobatDoc As Object

The above two lines i declare in genral

If InStr(1, filename, ".pdf") > 0 Then
      If Not (adAcrobatDoc Is Nothing) Then
         MsgBox " Aplication is already running"
         adAcrobatApp.Open (filename)
         Exit Sub
      ElseIf adAcrobatDoc Is Nothing Then
            MsgBox "Application not running"
          Set adAcrobatDoc = CreateObject("AcroExch.PDDoc")
          MsgBox filename
          adAcrobatApp.Open (filename)
      End If

This the code i written my porblem is iam getting the adobe window but its showing the file doesnot exsisit

and later few seconds debug msg that Runtime error:429 ActivexComponet can't create object so kindly help me how to resolve this issue

Thanks In advance

Web Star replied to bhanu priya on 04-Feb-10 06:40 AM

It is important to realize that Adobe Reader is not the same thing as Acrobat. If you are reading documentation, be sure you note which one (or both) it is talking about.

Developing with Acrobat, or Reader, should not rely on an object browser; be sure to use the Acrobat SDK. The object models are complicated. If Acrobat had been installed and your example had worked, the document opened would have been invisible because you did not open an AVDoc as well.


DL M replied to bhanu priya on 04-Feb-10 06:55 AM
File path should come immediately after the programm path:"C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe D:\test.pdf"

Try it with a local path, if it works try with a static server path and then a dynamic one to be able to localize the error source. If you use variables, watch their values by debugging modus.

Another try could be to map the server drive instead of using \\servername.