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
131 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

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

733 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