7 replies
by tclere
You can use the ShellExecute API function. This will open any file with it's associated application.
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
Sub OpenSomeFile()
Dim hWnd As Long
Dim sFile As String
sFile = "C:\Test\SomeFile.pdf"
Call ShellExecute(hWnd, vbNullString, sFile, vbNullString, vbNullString, vbNormalFocus)
End Sub
by cwy
by rrv
Two ways of doing this.
1. Use Shell( CreateProcess and WaitForSingleObject to do syncronous start of any windows application.
If you want the second method, i can give code in VB or youcan get sample code in any latest MSDN help.
All the best.
RV
by cwy
by cwy
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending