TPE
Tavvafi@gmail.com |
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
In the declarations section of your code, add:
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
Then to use ShellExecute use code like so:
Sub ShellExec() Dim strFile As String Dim strAction as String Dim lngErr As Long ' Edit this: strFile = "c:\somefile.txt" ' the file you want to open/etc. strAction = "OPEN" ' action might be OPEN, NEW or other, depending on what you need to do lngErr = ShellExecute(0, strAction, strFile, "", "", 0) ' optionally, add code to test lngErr End Sub