Results 1 to 3 of 3

Thread: [RESOLVED] Opening files listed in a List box

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Resolved [RESOLVED] Opening files listed in a List box

    I have a listbox on one of my Access forms. The listbox contains 4 fields, the first field is the filename. I want to make it so when a user doubleclicks on of the filenames in the listbox that the file will open in wordpad. Anyone know a good way to do this?

  2. #2
    Lively Member
    Join Date
    Jun 2005
    Posts
    112

    Re: Opening files listed in a List box

    If the filename in the listbox has the full path, use this

    VB Code:
    1. Private Sub List0_DblClick(Cancel As Integer)
    2.  
    3.     Shell "C:\Program Files\Windows NT\Accessories\wordpad.exe " & List0.Value, vbNormalFocus
    4.    
    5. End Sub

    Otherwise, add the file path to the end of the wordpad.exe string. Obviously if you're not on NT, the path to wordpad will be different too.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: [RESOLVED] Opening files listed in a List box

    Ty

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