Solved

I have a VB6 app that I want to add the ability to view a network folder and open a document when selected.

Posted on 2004-09-01
4
127 Views
Last Modified: 2010-05-02
How do I do this?

Thanks
0
Comment
Question by:sjmmajor
  • 2
4 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 250 total points
ID: 11958884
The fastest way is to use the CommonDialog control.  Add it to your project and then use something like this:

Private Sub OpenFile_Click()
    'Restrict the file type to text files *.txt
    CommonDialog1.Filter = "Text (*.txt)|*.txt"
    'Display the dialog box
    CommonDialog1.ShowOpen
    'If the user chose a file
    If CommonDialog1.FileName <> "" Then
        'Open the file (I can't be more specific without knowing what you plan to do with the file)
    End If
End Sub
0
 
LVL 10

Expert Comment

by:anv
ID: 11960508
0
 
LVL 76

Expert Comment

by:David Lee
ID: 12561449
Accept BlueDevilFan.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

707 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

20 Experts available now in Live!

Get 1:1 Help Now