Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    May 2003
    Location
    Detroit, Michigan, USA
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Opening File After Selection (Access 2000)

    I've been experimenting with the File Open dialog and I've got a really simple (and embarrassing) question. After a user selects the file from the dialog and I've saved it to a text box on my form, how do I actually open it? These could be Word or Excel or any type of Office file.

    I have references set for MSComDlg and Scripting and have played with both the Open and GetFile methods to no avail.

    What am I missing? <img src=/S/confused3.gif border=0 alt=confused3 width=45 height=45>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Opening File After Selection (Access 2000)

    The File Open dialog only provides you (the programmer) with a way to let the user select a file; it is up to you to do something with the selected file. The dialog has no built-in ability to do that.

    If you want the user to be able to select any kind of file, you can use Application.FollowHyperlink to open it in the associated application, i.e. .doc in Word, .xls in Excel etc.:

    Dim strFilename As String
    strFilename = ... ' get the name from the File Open dialog
    Application.FollowHyperlink strFilename

  3. #3
    New Lounger
    Join Date
    May 2003
    Location
    Detroit, Michigan, USA
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Opening File After Selection (Access 2000)

    Thanks Hans! This gave me the direction I needed. I actually ended up using the Follow Method after saving the file string to a hyperlink address on a control. It works great.

    Appreciate it!!

    Mike

Posting Permissions

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