Results 1 to 7 of 7

Thread: Open .pdf File from Visual Basic

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    Open .pdf File from Visual Basic

    How can i have my program open a .pdf file? The user should already have Adobe Acrobat Reader installed on their machines...

    Also, are there any free (or reallly cheap) pluggins to allow my program to open a .pdf file without having to open the external program?

    thank you again for your hlep

    squirrelly1
    Now happily married and still crankin' away at the keyboard. Life is grand for a coder, no?

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Use ShellExecute, giving it the path & filename to the PDF ..... that will cause what ever default app they have for PDF file to lauch and open it.
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

  4. #4
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    Acyially you could open Acrobat, using the shell command, then using the SetParent API command you could "insert" the WHOLE PDF Acrobat App inside a picture box...

    Do a search for Setparent on here...there are loads of examples...

    Woka

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    hmm..

    Should'nt this work???

    VB Code:
    1. Shell (App.Path & "\pdf\" & list.Text & ".pdf")

    i get an "Invalid procedure call or argument" error...

    ty,
    squirrelly1
    Now happily married and still crankin' away at the keyboard. Life is grand for a coder, no?

  6. #6
    Hyperactive Member VB4fun's Avatar
    Join Date
    May 2003
    Location
    too far from Fiji
    Posts
    342
    woka said:
    You could try opening it in the OLE object in the toolbar...... Is there no control in Project - Components list?


    Project-Components, Do you have Acrobat Control for ActiveX..?

    if so, I create a form (frmPDF) create the oject (Pdf1) and set the source (src):
    frmPdf.Pdf1.src = App.Path & "\Filename.pdf"

    works all the time for me..
    Last edited by VB4fun; Jul 21st, 2003 at 03:36 PM.
    Talk does not cook rice.
    -Chinese Proverb

  7. #7
    Addicted Member jewel's Avatar
    Join Date
    Jul 2003
    Location
    truly asia
    Posts
    153
    if you have the Adobe Acrobat 5.0 installed, try to look for the activex in your [Program Files]/Adobe/Acrobat 5.0/Acrobat/ActiveX -

    Try to check if the Adobe Reader also includes the .ocx file in its destination folder.
    xoxo

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