Results 1 to 5 of 5

Thread: executing a shortcut?

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2001
    Location
    NC
    Posts
    41

    executing a shortcut?

    How do you open a folder from vb to view its contents outside of a project?

    i.e. C:\My Documents\New Folder

    Thanks

    Jim
    Under the Bam
    Under the Boo
    Under the Bamboo tree

  2. #2
    Hyperactive Member deane034's Avatar
    Join Date
    May 2001
    Location
    Sri Lanka
    Posts
    485
    dosen't Shell excecute work?
    me.life = VB

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2001
    Location
    NC
    Posts
    41
    Nope it doesn't!

    Shell "C:\My Documents\NewFolder"

    if it were NewFolder.exe ...then yeah it would work!
    Under the Bam
    Under the Boo
    Under the Bamboo tree

  4. #4
    New Member
    Join Date
    Nov 2001
    Location
    Berkshire
    Posts
    10
    Use ShellExecute and the code

    Dim lngret As Long
    lngret = ShellExecute(Me.hwnd, vbNullString, _
    "C:\My Documents\New Folder", vbNullString, "C:\", SW_SHOWNORMAL)

    on your control
    Eliza

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2001
    Location
    NC
    Posts
    41
    Never heard of ShellExecute!
    Just Shell



    This works:

    Reference "Microsoft Shell Controls and Automation"

    Dim oFolder As Shell
    Set oFolder = New Shell

    oFolder.Open "C:\My Documents"

    Thanks anyways
    Under the Bam
    Under the Boo
    Under the Bamboo tree

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