?
Solved

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

Posted on 1999-01-14
4
Medium Priority
?
972 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
[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
  • 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 720 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

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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 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…
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

770 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