Solved

How do I call the "Open file dialog box" api in VB6

Posted on 1999-01-14
4
919 Views
Last Modified: 2008-03-10
All (well almost) program under Win95-98 uses the same openfile dialogbox API
how do I call this API with VB6
0
Comment
Question by:Lazypete
  • 2
4 Comments
 
LVL 1

Author Comment

by:Lazypete
ID: 1456409
If u need info about my question... fell free to ask
lazypete@total.net
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 180 total points
ID: 1456410
Do you really want to use API commands or you accept an easier substitute?

Here what I have to proposed (and you will have the standard dialog box). In fact, it is an OCX that calls those APIs.

Add the Microsoft Common Dialog Control to your project, place an instance on a form, also place a command button on this form and paste this code:
Private Sub Command1_Click()
    CommonDialog1.ShowOpen
    MsgBox CommonDialog1.FileName
End Sub

You cannot have a simplest solution.
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1456411
Pete,

emoreau's answer is far better than using any API calls. Use the common dialog control - and look at the help because there is an awful lot you can do with it to make it work exactly the way you want it to - especially look into how it can deal with long filenames and so on.
0
 
LVL 1

Author Comment

by:Lazypete
ID: 1456412
Exactly what I wanted..
Thanx a lot..
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…

776 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