Run the Associated file using ShellExecute
Run the Associated file using ShellExecute
API Declarations
Private 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
Private Const SW_SHOWNORMAL = 1
Rate Run the Associated file using ShellExecute
(1(1 Vote))
MsgBox RunAssociateFile("C:\tempDoc.htm")
End Sub
Public Function RunAssociateFile(ByVal strDocName As String) As Long
Dim Scr_hDC As Long
Dim lngRes As Long
Scr_hDC = GetDesktopWindow()
RunAssociateFile = ShellExecute(Scr_hDC, "Open", strDocName, "", "C:\", SW_SHOWNORMAL)
End Function
Run the Associated file using ShellExecute Comments
No comments yet — be the first to post one!
Post a Comment