|
-
Oct 20th, 2000, 04:45 PM
#1
Thread Starter
Addicted Member
Hi there,
I would like to know if it's possible to open a third party application from VB.
I have a form and a button. On click of the button, I would like to be able to open up an application (for example Drawme).
Thanks in advance.
-
Oct 20th, 2000, 04:55 PM
#2
-
Oct 20th, 2000, 05:26 PM
#3
Frenzied Member
Yep that's true, use this code if you want to open a file with it's default program (even urls!)
Code:
Public 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
'Open a file with it's default program
Public Sub Execute(file As String)
ShellExecute(hWnd, "Open", file, "", "", vbNormalFocus)
End Sub
'Usage
'Call Execute("c:\Drawme.drw")
have fun
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 20th, 2000, 06:35 PM
#4
Or if you want to open a file with a specific program, use the Shell method and pass the file for the command line argument.
Code:
Shell "Notepad.exe MyFile.txt", 1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|