Solved

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

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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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