Solved

VB6 - Browse to file

Posted on 2009-04-07
5
675 Views
Last Modified: 2012-05-06
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
Comment
Question by:Valleriani
  • 3
5 Comments
 
LVL 7

Expert Comment

by:cmrobertson
Comment Utility
0
 
LVL 7

Author Comment

by:Valleriani
Comment Utility
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
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
Comment Utility
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
 
LVL 7

Author Comment

by:Valleriani
Comment Utility
Bloody hell, that easy... Thanks, worked great!
0
 
LVL 7

Author Closing Comment

by:Valleriani
Comment Utility
Simple!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now