|
-
Jun 5th, 2002, 02:12 AM
#1
Thread Starter
New Member
How to open files
Hi, guys. I'm back and I have a problem.
How can I open any file? For example, the user types in a path and vb opens the file( a doc, bmp,psd or any registered extension). Can you help me out?
To make a program or not to make a program... that is the question. Or to destroy your computer's monitor, that's a second question
-
Jun 5th, 2002, 02:15 AM
#2
-= B u g S l a y e r =-
use ShellExecute if you want to launch default app.
sample
VB Code:
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpszOp As String, _
ByVal lpszFile As String, ByVal lpszParams As String, _
ByVal LpszDir As String, ByVal FsShowCmd As Long) _
As Long
Private Sub Command1_Click()
'Open a web page
Dim l As Long
l = ShellExecute(Me.hwnd, "Open", "http://www.vbworld.com", "", "C:\", vbNormal)
End Sub
Private Sub Command2_Click()
'Open a document
Dim l As Long
l = ShellExecute(Me.hwnd, "Open", App.Path & "\Test.Doc", "", "C:\", vbNormal)
End Sub
-
Jun 7th, 2002, 02:40 AM
#3
Thread Starter
New Member
To make a program or not to make a program... that is the question. Or to destroy your computer's monitor, that's a second question
-
Jun 7th, 2002, 04:02 AM
#4
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
|