Solved

Opening other programs

Posted on 1998-09-14
1
143 Views
Last Modified: 2012-05-04
How do you open another program via VB5?  like if you want to open Windows Explorer when you click a command button.  Thanks mucho!

   The Gringo
0
Comment
Question by:GringoHombre
1 Comment
 
LVL 2

Accepted Solution

by:
wj7ster earned 40 total points
ID: 1434871
Use the ShellExecute API:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Then Pass the path to the directory you want to open as a parameter:

Say you want to open the folder 'C:\' then

Dim lRet As Long

lRet = ShellExecute (Me.hwnd, vbNullString, "C:\", vbNullString, CurDir, 1)


0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB6 Compile Compatibility Issue 4 114
Using "ScreenUpdating" 6 73
vbModal 12 57
Copy a range from 1..n excel sheets to one destination sheet 2 55
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

791 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