Solved

VB6 - Browse to file

Posted on 2009-04-07
5
682 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

726 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