• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 689
  • Last Modified:

VB6 - Browse to file

I wanted to know if theres a way to browse to a file using a button in VB6.

For example:

I have a string that goes to "C:\foldername\test.txt".. I hit the browse button to go to that file, which should open the explorer and browse to that file, basicly.

How could this be possible for VB6? Thanks!

0
Valleriani
Asked:
Valleriani
  • 3
1 Solution
 
cmrobertsonCommented:
0
 
VallerianiAuthor Commented:
I'm confused here. Isn't common dialog for opening and saving files?

What I'm aiming to do is when a file is created via my program, I want a browse button so they can hit the button, and it will open up explorer and point to the file, much like when you download a file from the internet, I think FF and opera have it, where you can right click it and 'browse to file' and it will open explorer to the file, ready to be opened or deleted, whatever you want really.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Sure...see: http://support.microsoft.com/default.aspx?scid=kb;EN-US;q152457
Private somePath As String
 
Private Sub Command1_Click()
    somePath = "C:\foldername\test.txt"
    Shell "explorer /select," & somePath, vbNormalFocus
End Sub

Open in new window

0
 
VallerianiAuthor Commented:
Bloody hell, that easy... Thanks, worked great!
0
 
VallerianiAuthor Commented:
Simple!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now