Results 1 to 5 of 5

Thread: [RESOLVED] just a quickie how to open a folder

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2005
    Posts
    151

    Resolved [RESOLVED] just a quickie how to open a folder

    i was wondering how would i open a folder on a cd using code from clicking a label

  2. #2
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: just a quickie how to open a folder

    VB Code:
    1. Private Sub Label1_Click
    2. Shell "explorer.exe d:\windows", vbNormalFocus
    3. End Sub
    Change the path to the folder (including the drive letter if its on a cd)
    Chris

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jun 2005
    Posts
    151

    Re: just a quickie how to open a folder

    oops sorry i should of said im working from a cd trying to use the app.path method.

    i have labels named after the folder of where my apps are and when a user clicks on a label the corresponding folder opens.(well its supposed to)

  4. #4
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: just a quickie how to open a folder

    I assume you mean you have the labels caption set to the folder path? So you could do:

    VB Code:
    1. Private Sub Label1_Click
    2. Shell "explorer.exe " & App.Path & "\" & Label1.Caption, vbNormalFocus
    3. End Sub

    This will work if your labels caption is like 'MyFolder' or 'MyFolder\NewFolder' be sure to change the drive letter to your CD drive letter
    Chris

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2005
    Posts
    151

    Re: just a quickie how to open a folder

    thanks its working now cheers

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