Results 1 to 26 of 26

Thread: [RESOLVED] Run another program inside a form

Hybrid View

  1. #1
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Run another program inside a form

    I have it on both my systems and I only have Acrobat Reader which is free. You may not be able to distribute it but you can include the download link and installation of Reader from the installation of your app.

    If you have Reader 5 or 6 then its pdf.ocx. If you have Reader 7 or 8 then its AcroPDF.dll

    Add the control to your toolbox....
    Project > Components ... > check "Adobe Acrobat 7.0 Control Type Library" > click OK.
    (C:\...\Acrobat\ActiveX\AcroPDF.dll)

    Then drag the pdf control from the toolbox and drop on your form, resize, and supply a pdf file/path to the src property.


    vb Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4.     AcroPDF1.src = "C:\Users\VB-Guru\Documents\VS2005_Walkthroughs.pdf"
    5. End Sub
    Attached Images Attached Images  
    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

  2. #2

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    Re: Run another program inside a form

    Thanks for that!

    OK, I've put this control on my form and specified the src property but the file won't load. I get the Reader error " File doesn't begin with '%PDF-' ".

    Don't tell me - Adobe doesn't like spaces in the path? I'll test this now but if so this is yet another thing to hate about Adobe and pdf files - grr!
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

  3. #3

    Thread Starter
    Fanatic Member paulorton's Avatar
    Join Date
    Aug 2006
    Location
    West Wales
    Posts
    809

    Re: Run another program inside a form

    Nope - same error message with "C:\GP1-1.pdf" as the source.
    Anyone any idea what's wrong?
    Paul Orton
    VB6
    Visual Web Developer 2008 Express Edition
    Microsoft Visual Basic 2012 Express

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