Solved

VB6 - Browse to file

Posted on 2009-04-07
5
681 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 7

Expert Comment

by:cmrobertson
ID: 24092324
0
 
LVL 7

Author Comment

by:Valleriani
ID: 24092436
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 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 24092516
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
ID: 24092605
Bloody hell, that easy... Thanks, worked great!
0
 
LVL 7

Author Closing Comment

by:Valleriani
ID: 31567782
Simple!
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…

738 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