Solved

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

Posted on 1999-01-14
4
912 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 69

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

895 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

16 Experts available now in Live!

Get 1:1 Help Now