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 Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Dim sFile As String
sFile = "C:\WINDOWS\system32\sndrec32.exe"
Call ShellExecute(hwnd, "Open", sFile, "", App.Path, 1)
Sleep 2000
DoEvents
SendKeys "%{e}"
SendKeys "{DOWN}"
SendKeys "{DOWN}"
SendKeys "{DOWN}"
SendKeys "{ENTER}"
End Sub