Hi Dan
I think the code I used was just copied from your suggestion:
Option Compare Database
Option Explicit
Private Declare Function FindWindowEx Lib "user32" Alias
"FindWindowExA" _
(ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String,
ByVal lpsz2 As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer,
ByVal lParam As Any) As Long
Const EDAPI_WINDOWCAPTION As String = "Express Dictate"
Const WM_EDAPI_COMMAND As Long = &H7FFF
Public Function EDAPISendCommandDan(iCommand As Integer) As Long
Dim hwnd As Long
hwnd = FindWindowEx(0&, 0&, vbNullString, EDAPI_WINDOWCAPTION)
'hwnd = FindWindowEx(Null, Null, Null, EDAPI_WINDOWCAPTION)
If hwnd = 0 Then
' Express Dictate not running.
' Either attempt to run Express Dictate
' or spit out error message here...
Exit Function
Else
EDAPISendCommandDan = SendMessage(hwnd, WM_EDAPI_COMMAND,
iCommand, vbNullString)
End If
End Function
I was calling it like:
EDAPISendCommandDan 3
I'll let you know if another solution shows up. Thanks for your help!