Results 1 to 5 of 5

Thread: i need help pls for openfiledialog

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2006
    Posts
    50

    i need help pls for openfiledialog

    i got the code /Me.OpenFileDialog1.ShowDialog()/ but my problem is how can i open the PDF file in my code thanks
    Last edited by info; Apr 14th, 2006 at 02:46 PM.

  2. #2
    Hyperactive Member francisstokes's Avatar
    Join Date
    May 2005
    Location
    Kent, England
    Posts
    272

    Re: i need help pls for openfiledialog

    An open file dialog won't *actually* open a files for you. It just provides an interface for you to select the document / directory.

  3. #3
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,020

    Re: i need help pls for openfiledialog

    you can use openfiledialog to obtain a filepath and then use this to open it:

    VB Code:
    1. process.start(filename)
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  4. #4
    "The" RedHeadedLefty
    Join Date
    Aug 2005
    Location
    College Station, TX Preferred Nickname: Gig Current Mood: Just Peachy Turnons: String Manipulation
    Posts
    4,495

    Re: i need help pls for openfiledialog

    You can use Process.Start in order to open the file using the default program on the system used to open PDF files, by using the filename returned by the OpenFileDialog...
    VB Code:
    1. If MyOpenFileDialog.ShowDialog = DialogResult.OK then
    2.      System.Diagnostics.Process.Start(MyOpenFileDialog.FileName)
    3. End If
    If you are talking about opening it for editing or something like that from within your program, then that would require some sort of external library...

  5. #5
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,461

    Re: i need help pls for openfiledialog

    Calling Process.Start will open the file in the default application, which is often what you want. In the case of a PDF this will usually be Adobe Reader. If you actually want to display the PDF inside your own app then you can do so by adding the ActiveX control provided by Adobe to a form. If you have Adobe Reader on your machine then you have the control already. You can add it to the toolbox by right-clicking, selecting the appropriate option and then finding the control on the COM tab. Once it's in the toolbox you can add an instance to your form. If you just want to open Adobe Reader then disregard everything I just said and have a nice day.

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