Results 1 to 5 of 5

Thread: opening acad and acrobat

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2004
    Posts
    8

    Thumbs down opening acad and acrobat

    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.

  2. #2

    Thread Starter
    New Member
    Join Date
    Jun 2004
    Posts
    8

    Wink PS

    i have referenced acrobat and acad tlb and dll files in the project references - so that is not a problem

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    Dont you need to create the instance of acrobat too?
    VB Code:
    1. Set adb = New Acrobat.CAcroAVDoc
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    New Member
    Join Date
    Jun 2004
    Posts
    8

    Angry

    that did not work...

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

    thanks

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    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.

    VB Code:
    1. Option Explicit
    2. 'Add reference to acrobat 5.0
    3. 'Add one command button
    4. 'Add one commondialog control
    5. Dim oApp As Acrobat.CAcroApp
    6.  
    7. Private Sub Form_Load()
    8.     Set oApp = CreateObject("AcroExch.App")
    9. End Sub
    10.  
    11. Private Sub Form_Unload(Cancel As Integer)
    12.     If Not oApp Is Nothing Then
    13.         oApp.Exit
    14.     End If
    15.     Set oApp = Nothing
    16. End Sub
    17.  
    18. Private Sub Command1_Click()
    19.    
    20.     Dim pdfDoc As Acrobat.CAcroPDDoc
    21.     Dim sPath As String
    22.    
    23.     'Path to an existing pdf document
    24.     CommonDialog1.ShowOpen
    25.     sPath = CommonDialog1.FileName
    26.     Set pdfDoc = CreateObject("AcroExch.PDDoc")
    27.     If pdfDoc.Open(sPath) Then
    28.         '...
    29.     Else
    30.         '...
    31.     Endif
    32.  
    33. End Sub
    HTH
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width